mirror of
https://github.com/github/codeql.git
synced 2026-04-24 00:05:14 +02:00
JS: Remove BasicBlockInternal module and mark relevant predicates as public
This exposes the predicates publicly, but will be hidden again in the next commit.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
private import javascript as js
|
||||
private import codeql.ssa.Ssa
|
||||
private import semmle.javascript.internal.BasicBlockInternal as BasicBlockInternal
|
||||
|
||||
private module SsaConfig implements InputSig<js::DbLocation> {
|
||||
class ControlFlowNode = js::ControlFlowNode;
|
||||
@@ -38,8 +39,7 @@ private module SsaConfig implements InputSig<js::DbLocation> {
|
||||
bb.useAt(i, v, _) and certain = true
|
||||
}
|
||||
|
||||
predicate getImmediateBasicBlockDominator =
|
||||
js::BasicBlockInternal::getImmediateBasicBlockDominator/1;
|
||||
predicate getImmediateBasicBlockDominator = BasicBlockInternal::immediateDominator/1;
|
||||
|
||||
pragma[inline]
|
||||
BasicBlock getABasicBlockSuccessor(BasicBlock bb) { result = bb.getASuccessor() }
|
||||
|
||||
@@ -7,11 +7,6 @@ import javascript
|
||||
private import semmle.javascript.internal.StmtContainers
|
||||
private import semmle.javascript.internal.CachedStages
|
||||
|
||||
module BasicBlockInternal {
|
||||
// TODO: Expose these as public predicate in a private module instead of this hack.
|
||||
predicate getImmediateBasicBlockDominator = immediateDominator/1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `nd` starts a new basic block.
|
||||
*/
|
||||
@@ -109,13 +104,11 @@ private import Internal
|
||||
|
||||
/** Gets the immediate dominator of `bb`. */
|
||||
cached
|
||||
private BasicBlock immediateDominator(BasicBlock bb) =
|
||||
idominance(entryBB/1, succBB/2)(_, result, bb)
|
||||
BasicBlock immediateDominator(BasicBlock bb) = idominance(entryBB/1, succBB/2)(_, result, bb)
|
||||
|
||||
/** Gets the immediate post-dominator of `bb`. */
|
||||
cached
|
||||
private BasicBlock immediatePostDominator(BasicBlock bb) =
|
||||
idominance(exitBB/1, predBB/2)(_, result, bb)
|
||||
BasicBlock immediatePostDominator(BasicBlock bb) = idominance(exitBB/1, predBB/2)(_, result, bb)
|
||||
|
||||
/**
|
||||
* A basic block, that is, a maximal straight-line sequence of control flow nodes
|
||||
|
||||
Reference in New Issue
Block a user