mirror of
https://github.com/github/codeql.git
synced 2026-04-12 02:24:00 +02:00
C++: Add a predicate for getting the 0'th child of a 'ConditionDeclExpr' without casting it to a 'VariableAccess' and use it in IR generation.
This commit is contained in:
@@ -244,9 +244,15 @@ class ConditionDeclExpr extends Expr, @condition_decl {
|
||||
|
||||
/**
|
||||
* Gets the compiler-generated variable access that conceptually occurs after
|
||||
* the initialization of the declared variable.
|
||||
* the initialization of the declared variable, if any.
|
||||
*/
|
||||
VariableAccess getVariableAccess() { result = this.getChild(0) }
|
||||
VariableAccess getVariableAccess() { result = this.getExpr() }
|
||||
|
||||
/**
|
||||
* Gets the expression that is evaluated after the initialization of the declared
|
||||
* variable.
|
||||
*/
|
||||
Expr getExpr() { result = this.getChild(0) }
|
||||
|
||||
/**
|
||||
* Gets the expression that initializes the declared variable. This predicate
|
||||
|
||||
Reference in New Issue
Block a user