Skip to content

Commit 1138649

Browse files
committed
C++: Factor out the property provider which hides instructions and operands out of the 'LocalFlowPropertyProvider' class and into a separate class.
1 parent e87b391 commit 1138649

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+
* 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)