Skip to content

Commit 316d932

Browse files
authored
Merge pull request github#3198 from MathiasVP/valuenumbering-provider-new-file
C++/C#: Prevent accidental import of ValueNumberPropertyProvider
2 parents a8098a2 + c54cdde commit 316d932

File tree

12 files changed

+93
-75
lines changed

12 files changed

+93
-75
lines changed

config/identical-files.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,13 @@
242242
"csharp/ql/src/semmle/code/csharp/ir/implementation/raw/gvn/ValueNumbering.qll",
243243
"csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/gvn/ValueNumbering.qll"
244244
],
245+
"C++ IR PrintValueNumbering": [
246+
"cpp/ql/src/semmle/code/cpp/ir/implementation/raw/gvn/PrintValueNumbering.qll",
247+
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/gvn/PrintValueNumbering.qll",
248+
"cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/gvn/PrintValueNumbering.qll",
249+
"csharp/ql/src/semmle/code/csharp/ir/implementation/raw/gvn/PrintValueNumbering.qll",
250+
"csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/gvn/PrintValueNumbering.qll"
251+
],
245252
"C++ IR ConstantAnalysis": [
246253
"cpp/ql/src/semmle/code/cpp/ir/implementation/raw/constant/ConstantAnalysis.qll",
247254
"cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/constant/ConstantAnalysis.qll",
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
*/
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/raw/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
*/
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/unaliased_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
*/

cpp/ql/test/library-tests/valuenumbering/GlobalValueNumbering/ir_gvn.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
import semmle.code.cpp.ir.PrintIR
66
import semmle.code.cpp.ir.IR
77
import semmle.code.cpp.ir.ValueNumbering
8+
import semmle.code.cpp.ir.implementation.aliased_ssa.gvn.PrintValueNumbering
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+
}

csharp/ql/src/semmle/code/csharp/ir/implementation/raw/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)