Skip to content

Commit 56a0bba

Browse files
committed
C++: Merge two cached stages.
1 parent 8c0a7e6 commit 56a0bba

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
@@ -646,21 +646,6 @@ class SsaSynthNode extends Node, TSsaSynthNode {
646646
override string toStringImpl() { result = node.toString() }
647647
}
648648

649-
/**
650-
* Holds if `n` has a local flow step that goes through a back-edge.
651-
*/
652-
cached
653-
predicate flowsToBackEdge(Node n) {
654-
exists(Node succ, IRBlock bb1, IRBlock bb2 |
655-
Ssa::ssaFlow(n, succ) and
656-
bb1 = n.getBasicBlock() and
657-
bb2 = succ.getBasicBlock() and
658-
bb1 != bb2 and
659-
bb2.dominates(bb1) and
660-
bb1.getASuccessor+() = bb2
661-
)
662-
}
663-
664649
/**
665650
* INTERNAL: do not use.
666651
*
@@ -1661,6 +1646,21 @@ predicate hasInstructionAndIndex(
16611646

16621647
cached
16631648
private module Cached {
1649+
/**
1650+
* Holds if `n` has a local flow step that goes through a back-edge.
1651+
*/
1652+
cached
1653+
predicate flowsToBackEdge(Node n) {
1654+
exists(Node succ, IRBlock bb1, IRBlock bb2 |
1655+
Ssa::ssaFlow(n, succ) and
1656+
bb1 = n.getBasicBlock() and
1657+
bb2 = succ.getBasicBlock() and
1658+
bb1 != bb2 and
1659+
bb2.dominates(bb1) and
1660+
bb1.getASuccessor+() = bb2
1661+
)
1662+
}
1663+
16641664
/**
16651665
* Holds if data flows from `nodeFrom` to `nodeTo` in exactly one local
16661666
* (intra-procedural) step. This relation is only used for local dataflow

0 commit comments

Comments
 (0)