Skip to content

Commit fdb9fb5

Browse files
committed
C++: Remove the rank aggregate from 'SsaInternals.qll'.
1 parent 586fddb commit fdb9fb5

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternals.qll

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff 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-
6454
private 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();

0 commit comments

Comments
 (0)