Skip to content

Commit 43459c1

Browse files
committed
C++: Modernize the PrintIRStoreSteps (and rename it to PrintIRFieldFlowSteps) after the use-use flow changes.
1 parent 8ee7694 commit 43459c1

File tree

2 files changed

+40
-33
lines changed

2 files changed

+40
-33
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* Print the dataflow local store steps in IR dumps.
3+
*/
4+
5+
private import cpp
6+
private import semmle.code.cpp.ir.IR
7+
private import semmle.code.cpp.ir.dataflow.internal.DataFlowUtil
8+
private import semmle.code.cpp.ir.dataflow.internal.DataFlowPrivate
9+
private import PrintIRUtilities
10+
11+
/**
12+
* Property provider for local IR dataflow store steps.
13+
*/
14+
class FieldFlowPropertyProvider extends IRPropertyProvider {
15+
override string getOperandProperty(Operand operand, string key) {
16+
exists(PostFieldUpdateNode pfun, Content content |
17+
key = "store " + content.toString() and
18+
operand = pfun.getPreUpdateNode().(IndirectOperand).getOperand() and
19+
result =
20+
strictconcat(string element, Node node |
21+
storeStep(node, content, pfun) and
22+
element = nodeId(node, _, _)
23+
|
24+
element, ", "
25+
)
26+
)
27+
or
28+
exists(Node node2, Content content |
29+
key = "read " + content.toString() and
30+
operand = node2.(IndirectOperand).getOperand() and
31+
result =
32+
strictconcat(string element, Node node1 |
33+
readStep(node1, content, node2) and
34+
element = nodeId(node1, _, _)
35+
|
36+
element, ", "
37+
)
38+
)
39+
}
40+
}

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

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)