Skip to content

Commit 412ea67

Browse files
authored
Merge pull request github#15075 from MathiasVP/print-data-flow-relevant-IR
C++: Add a `PropertyProvider` for only showing dataflow-relevant IR
2 parents 3c2336e + 1ad0e65 commit 412ea67

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
private import cpp
2+
private import semmle.code.cpp.ir.IR
3+
private import SsaInternals as Ssa
4+
5+
/**
6+
* A property provider that hides all instructions and operands that are not relevant for IR dataflow.
7+
*/
8+
class DataFlowRelevantIRPropertyProvider extends IRPropertyProvider {
9+
override predicate shouldPrintOperand(Operand operand) { not Ssa::ignoreOperand(operand) }
10+
11+
override predicate shouldPrintInstruction(Instruction instr) { not Ssa::ignoreInstruction(instr) }
12+
}

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,4 @@ class LocalFlowPropertyProvider extends IRPropertyProvider {
5959
result = getNodeProperty(node, key)
6060
)
6161
}
62-
63-
override predicate shouldPrintOperand(Operand operand) { not Ssa::ignoreOperand(operand) }
64-
65-
override predicate shouldPrintInstruction(Instruction instr) { not Ssa::ignoreInstruction(instr) }
6662
}

0 commit comments

Comments
 (0)