Skip to content

Commit 1e3419f

Browse files
committed
C++/C#: generate IR for funcs excluded in PrintIR
Previously, functions excluded from PrintIR would not have IR generated. This sometimes affected escacpe analysis of functions that were printed.
1 parent 0da554c commit 1e3419f

File tree

5 files changed

+0
-45
lines changed

5 files changed

+0
-45
lines changed

cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/PrintIR.qll

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@ private predicate shouldPrintFunction(Language::Function func) {
2222
exists(PrintIRConfiguration config | config.shouldPrintFunction(func))
2323
}
2424

25-
/**
26-
* Override of `IRConfiguration` to only create IR for the functions that are to be dumped.
27-
*/
28-
private class FilteredIRConfiguration extends IRConfiguration {
29-
override predicate shouldCreateIRForFunction(Language::Function func) {
30-
shouldPrintFunction(func)
31-
}
32-
}
33-
3425
private string getAdditionalInstructionProperty(Instruction instr, string key) {
3526
exists(IRPropertyProvider provider | result = provider.getInstructionProperty(instr, key))
3627
}

cpp/ql/src/semmle/code/cpp/ir/implementation/raw/PrintIR.qll

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@ private predicate shouldPrintFunction(Language::Function func) {
2222
exists(PrintIRConfiguration config | config.shouldPrintFunction(func))
2323
}
2424

25-
/**
26-
* Override of `IRConfiguration` to only create IR for the functions that are to be dumped.
27-
*/
28-
private class FilteredIRConfiguration extends IRConfiguration {
29-
override predicate shouldCreateIRForFunction(Language::Function func) {
30-
shouldPrintFunction(func)
31-
}
32-
}
33-
3425
private string getAdditionalInstructionProperty(Instruction instr, string key) {
3526
exists(IRPropertyProvider provider | result = provider.getInstructionProperty(instr, key))
3627
}

cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/PrintIR.qll

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@ private predicate shouldPrintFunction(Language::Function func) {
2222
exists(PrintIRConfiguration config | config.shouldPrintFunction(func))
2323
}
2424

25-
/**
26-
* Override of `IRConfiguration` to only create IR for the functions that are to be dumped.
27-
*/
28-
private class FilteredIRConfiguration extends IRConfiguration {
29-
override predicate shouldCreateIRForFunction(Language::Function func) {
30-
shouldPrintFunction(func)
31-
}
32-
}
33-
3425
private string getAdditionalInstructionProperty(Instruction instr, string key) {
3526
exists(IRPropertyProvider provider | result = provider.getInstructionProperty(instr, key))
3627
}

csharp/ql/src/semmle/code/csharp/ir/implementation/raw/PrintIR.qll

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@ private predicate shouldPrintFunction(Language::Function func) {
2222
exists(PrintIRConfiguration config | config.shouldPrintFunction(func))
2323
}
2424

25-
/**
26-
* Override of `IRConfiguration` to only create IR for the functions that are to be dumped.
27-
*/
28-
private class FilteredIRConfiguration extends IRConfiguration {
29-
override predicate shouldCreateIRForFunction(Language::Function func) {
30-
shouldPrintFunction(func)
31-
}
32-
}
33-
3425
private string getAdditionalInstructionProperty(Instruction instr, string key) {
3526
exists(IRPropertyProvider provider | result = provider.getInstructionProperty(instr, key))
3627
}

csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/PrintIR.qll

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@ private predicate shouldPrintFunction(Language::Function func) {
2222
exists(PrintIRConfiguration config | config.shouldPrintFunction(func))
2323
}
2424

25-
/**
26-
* Override of `IRConfiguration` to only create IR for the functions that are to be dumped.
27-
*/
28-
private class FilteredIRConfiguration extends IRConfiguration {
29-
override predicate shouldCreateIRForFunction(Language::Function func) {
30-
shouldPrintFunction(func)
31-
}
32-
}
33-
3425
private string getAdditionalInstructionProperty(Instruction instr, string key) {
3526
exists(IRPropertyProvider provider | result = provider.getInstructionProperty(instr, key))
3627
}

0 commit comments

Comments
 (0)