Skip to content

Commit 6fa0d2e

Browse files
committed
Use shared getScope instead of getRoot
1 parent cecf92c commit 6fa0d2e

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

go/ql/lib/semmle/go/controlflow/BasicBlocks.qll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ private module BbImpl = BB::Make<Location, Input>;
4848
class BasicBlock extends BbImpl::BasicBlock {
4949
/** Gets the basic block that immediately dominates this basic block. */
5050
ReachableBasicBlock getImmediateDominator() { result.immediatelyDominates(this) }
51-
52-
/** Gets the innermost function or file to which this basic block belongs. */
53-
ControlFlow::Root getRoot() { result = this.getScope() }
5451
}
5552

5653
cached

go/ql/lib/semmle/go/dataflow/SSA.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class SsaDefinition extends TSsaDefinition {
144144
abstract string prettyPrintRef();
145145

146146
/** Gets the innermost function or file to which this SSA definition belongs. */
147-
ControlFlow::Root getRoot() { result = this.getBasicBlock().getRoot() }
147+
ControlFlow::Root getRoot() { result = this.getBasicBlock().getScope() }
148148

149149
/** Gets a textual representation of this element. */
150150
string toString() { result = this.prettyPrintDef() }

go/ql/lib/semmle/go/dataflow/SsaImpl.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ private module Internal {
8686

8787
/** Holds if the `i`th node of `bb` in function `f` is an entry node. */
8888
private predicate entryNode(FuncDef f, ReachableBasicBlock bb, int i) {
89-
f = bb.getRoot() and
89+
f = bb.getScope() and
9090
bb.getNode(i).isEntryNode()
9191
}
9292

9393
/**
9494
* Holds if the `i`th node of `bb` in function `f` is a function call.
9595
*/
9696
private predicate callNode(FuncDef f, ReachableBasicBlock bb, int i) {
97-
f = bb.getRoot() and
97+
f = bb.getScope() and
9898
bb.getNode(i).(IR::EvalInstruction).getExpr() instanceof CallExpr
9999
}
100100

0 commit comments

Comments
 (0)