mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
SSA: Add BasicBlock.{getNode/1,length/0} to the input signature
This commit is contained in:
@@ -24,6 +24,8 @@ private module CaptureInput implements Shared::InputSig<Location> {
|
||||
}
|
||||
|
||||
class BasicBlock extends PY::BasicBlock {
|
||||
int length() { result = count(int i | exists(this.getNode(i))) }
|
||||
|
||||
Callable getEnclosingCallable() { result = this.getScope() }
|
||||
|
||||
// Note `PY:BasicBlock` does not have a `getLocation`.
|
||||
@@ -34,6 +36,8 @@ private module CaptureInput implements Shared::InputSig<Location> {
|
||||
Location getLocation() { result = super.getNode(0).getLocation() }
|
||||
}
|
||||
|
||||
class ControlFlowNode = PY::ControlFlowNode;
|
||||
|
||||
BasicBlock getImmediateBasicBlockDominator(BasicBlock bb) { result = bb.getImmediateDominator() }
|
||||
|
||||
BasicBlock getABasicBlockSuccessor(BasicBlock bb) { result = bb.getASuccessor() }
|
||||
|
||||
Reference in New Issue
Block a user