Skip to content

Commit f351558

Browse files
committed
C++: While here, let's avoid materializing 'ensuresEq' and 'ensuresLt' when computing unreachable nodes in dataflow.
1 parent 9b6f39c commit f351558

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,12 +1237,14 @@ module IsUnreachableInCall {
12371237
int getValue() { result = value }
12381238
}
12391239

1240-
pragma[nomagic]
1240+
bindingset[right]
1241+
pragma[inline_late]
12411242
private predicate ensuresEq(Operand left, Operand right, int k, IRBlock block, boolean areEqual) {
12421243
any(G::IRGuardCondition guard).ensuresEq(left, right, k, block, areEqual)
12431244
}
12441245

1245-
pragma[nomagic]
1246+
bindingset[right]
1247+
pragma[inline_late]
12461248
private predicate ensuresLt(Operand left, Operand right, int k, IRBlock block, boolean areEqual) {
12471249
any(G::IRGuardCondition guard).ensuresLt(left, right, k, block, areEqual)
12481250
}

cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/gvn/ValueNumbering.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class ValueNumber extends TValueNumber {
5151
/**
5252
* Gets an `Operand` whose definition is exact and has this value number.
5353
*/
54+
pragma[nomagic]
5455
final Operand getAUse() { this = valueNumber(result.getDef()) }
5556

5657
final string getKind() {

0 commit comments

Comments
 (0)