File tree Expand file tree Collapse file tree 1 file changed +3
-24
lines changed
cpp/ql/src/semmle/code/cpp/ir/implementation/raw/internal Expand file tree Collapse file tree 1 file changed +3
-24
lines changed Original file line number Diff line number Diff line change @@ -17,36 +17,15 @@ Type getIntType() {
1717 result .( IntType ) .isImplicitlySigned ( )
1818}
1919
20- /**
21- * If `expr` is a conversion, gets the expression being converted. Otherwise,
22- * returns `expr`.
23- */
24- private Expr getUnconvertedExpr ( Expr expr ) {
25- if expr instanceof Conversion then (
26- result = getUnconvertedExpr ( expr .( Conversion ) .getExpr ( ) )
27- ) else (
28- result = expr
29- )
30- }
31-
3220/**
3321 * Gets the "real" parent of `expr`. This predicate treats conversions as if
3422 * they were explicit nodes in the expression tree, rather than as implicit
3523 * nodes as in the regular AST representation.
3624 */
3725private Element getRealParent ( Expr expr ) {
38- if expr .hasConversion ( ) then (
39- // The expression has a conversion, so treat that as its parent
40- result = expr .getConversion ( )
41- )
42- else (
43- // Either the expression is a top-level conversion, or it's not a
44- // conversion. The real parent is the parent of the original unconverted
45- // expression.
46- result = getUnconvertedExpr ( expr ) .getParent ( ) or
47- // The parent of a DestructorDestruction is the destructor itself.
48- result .( Destructor ) .getADestruction ( ) = expr
49- )
26+ result = expr .getParentWithConversions ( )
27+ or
28+ result .( Destructor ) .getADestruction ( ) = expr
5029}
5130
5231/**
You can’t perform that action at this time.
0 commit comments