Skip to content

Commit 35687ea

Browse files
committed
C++: Merge two cached stages.
1 parent 7bfd47a commit 35687ea

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -712,21 +712,6 @@ class SsaSynthNode extends Node, TSsaSynthNode {
712712
override string toStringImpl() { result = node.toString() }
713713
}
714714

715-
/**
716-
* Holds if `n` has a local flow step that goes through a back-edge.
717-
*/
718-
cached
719-
predicate flowsToBackEdge(Node n) {
720-
exists(Node succ, IRBlock bb1, IRBlock bb2 |
721-
Ssa::ssaFlow(n, succ) and
722-
bb1 = n.getBasicBlock() and
723-
bb2 = succ.getBasicBlock() and
724-
bb1 != bb2 and
725-
bb2.dominates(bb1) and
726-
bb1.getASuccessor+() = bb2
727-
)
728-
}
729-
730715
/**
731716
* INTERNAL: do not use.
732717
*
@@ -1727,6 +1712,21 @@ predicate hasInstructionAndIndex(
17271712

17281713
cached
17291714
private module Cached {
1715+
/**
1716+
* Holds if `n` has a local flow step that goes through a back-edge.
1717+
*/
1718+
cached
1719+
predicate flowsToBackEdge(Node n) {
1720+
exists(Node succ, IRBlock bb1, IRBlock bb2 |
1721+
Ssa::ssaFlow(n, succ) and
1722+
bb1 = n.getBasicBlock() and
1723+
bb2 = succ.getBasicBlock() and
1724+
bb1 != bb2 and
1725+
bb2.dominates(bb1) and
1726+
bb1.getASuccessor+() = bb2
1727+
)
1728+
}
1729+
17301730
/**
17311731
* Holds if data flows from `nodeFrom` to `nodeTo` in exactly one local
17321732
* (intra-procedural) step. This relation is only used for local dataflow

0 commit comments

Comments
 (0)