File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed
cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -51,16 +51,6 @@ private newtype TDefOrUse =
5151 TExplicitUse ( Operand op ) { isExplicitUse ( op ) } or
5252 TReturnParamIndirection ( Operand op ) { returnParameterIndirection ( op , _) }
5353
54- pragma [ nomagic]
55- private int getRank ( DefOrUse defOrUse , IRBlock block ) {
56- defOrUse =
57- rank [ result ] ( int i , DefOrUse cand |
58- block .getInstruction ( i ) = toInstruction ( cand )
59- |
60- cand order by i
61- )
62- }
63-
6454private class DefOrUse extends TDefOrUse {
6555 /** Gets the instruction associated with this definition, if any. */
6656 Instruction asDef ( ) { none ( ) }
@@ -75,8 +65,9 @@ private class DefOrUse extends TDefOrUse {
7565 abstract IRBlock getBlock ( ) ;
7666
7767 /** Holds if this definition or use has rank `rank` in block `block`. */
78- cached
79- final predicate hasRankInBlock ( IRBlock block , int rnk ) { rnk = getRank ( this , block ) }
68+ final predicate hasIndexInBlock ( IRBlock block , int index ) {
69+ block .getInstruction ( index ) = toInstruction ( this )
70+ }
8071
8172 /** Gets the location of this element. */
8273 abstract Cpp:: Location getLocation ( ) ;
You can’t perform that action at this time.
0 commit comments