mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
C++: Introduce 'getAnElementExpr' and 'getAnExpr'.
This commit is contained in:
@@ -187,8 +187,22 @@ class ClassAggregateLiteral extends AggregateLiteral {
|
||||
override string getAPrimaryQlClass() { result = "ClassAggregateLiteral" }
|
||||
|
||||
/**
|
||||
* Gets an expression within the aggregate literal that is used to initialize
|
||||
* field `field`, if present.
|
||||
*
|
||||
* This predicate may have multiple results since a field can be initialized
|
||||
* multiple times in the same initializer.
|
||||
*/
|
||||
Expr getAFieldExpr(Field field) { result = this.getFieldExpr(field, _) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getAFieldExpr` instead.
|
||||
*
|
||||
* Gets the expression within the aggregate literal that is used to initialize
|
||||
* field `field`, if present.
|
||||
*
|
||||
* This predicate may have multiple results since a field can be initialized
|
||||
* multiple times in the same initializer.
|
||||
*/
|
||||
Expr getFieldExpr(Field field) { result = this.getFieldExpr(field, _) }
|
||||
|
||||
@@ -274,8 +288,22 @@ class ArrayOrVectorAggregateLiteral extends AggregateLiteral {
|
||||
Type getElementType() { none() }
|
||||
|
||||
/**
|
||||
* Gets an expression within the aggregate literal that is used to initialize
|
||||
* element `elementIndex`, if present.
|
||||
*
|
||||
* This predicate may have multiple results since an element can be initialized
|
||||
* multiple times in the same initializer.
|
||||
*/
|
||||
Expr getAnElementExpr(int elementIndex) { result = this.getElementExpr(elementIndex, _) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getAnElementExpr` instead.
|
||||
*
|
||||
* Gets the expression within the aggregate literal that is used to initialize
|
||||
* element `elementIndex`, if present.
|
||||
*
|
||||
* This predicate may have multiple results since an element can be initialized
|
||||
* multiple times in the same initializer.
|
||||
*/
|
||||
Expr getElementExpr(int elementIndex) { result = this.getElementExpr(elementIndex, _) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user