Skip to content

Commit 0f70944

Browse files
committed
C++: Move ValueNumberPropertyProvider into its own file to prevent accidental imports
1 parent 604731b commit 0f70944

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
private import internal.ValueNumberingImports
2+
private import ValueNumbering
3+
4+
/**
5+
* Provides additional information about value numbering in IR dumps.
6+
*/
7+
class ValueNumberPropertyProvider extends IRPropertyProvider {
8+
override string getInstructionProperty(Instruction instr, string key) {
9+
exists(ValueNumber vn |
10+
vn = valueNumber(instr) and
11+
key = "valnum" and
12+
if strictcount(vn.getAnInstruction()) > 1
13+
then result = vn.getDebugString()
14+
else result = "unique"
15+
)
16+
}
17+
}

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
11
private import internal.ValueNumberingInternal
22
private import internal.ValueNumberingImports
33

4-
/**
5-
* Provides additional information about value numbering in IR dumps.
6-
*/
7-
class ValueNumberPropertyProvider extends IRPropertyProvider {
8-
override string getInstructionProperty(Instruction instr, string key) {
9-
exists(ValueNumber vn |
10-
vn = valueNumber(instr) and
11-
key = "valnum" and
12-
if strictcount(vn.getAnInstruction()) > 1
13-
then result = vn.getDebugString()
14-
else result = "unique"
15-
)
16-
}
17-
}
18-
194
/**
205
* The value number assigned to a particular set of instructions that produce equivalent results.
216
*/

0 commit comments

Comments
 (0)