mirror of
https://github.com/github/codeql.git
synced 2026-05-02 20:25:13 +02:00
SSA: Add SsaNode predicates that don't mention DefinitionExt.
This commit is contained in:
@@ -1715,6 +1715,15 @@ module Make<LocationSig Location, InputSig<Location> Input> {
|
||||
abstract private class SsaNodeImpl extends NodeImpl {
|
||||
/** Gets the underlying SSA definition. */
|
||||
abstract DefinitionExt getDefinitionExt();
|
||||
|
||||
/** Gets the SSA definition this node corresponds to, if any. */
|
||||
Definition asDefinition() { this = TSsaDefinitionNode(result) }
|
||||
|
||||
/** Gets the basic block to which this node belongs. */
|
||||
abstract BasicBlock getBasicBlock();
|
||||
|
||||
/** Gets the underlying source variable that this node tracks flow for. */
|
||||
abstract SourceVariable getSourceVariable();
|
||||
}
|
||||
|
||||
final class SsaNode = SsaNodeImpl;
|
||||
@@ -1727,6 +1736,10 @@ module Make<LocationSig Location, InputSig<Location> Input> {
|
||||
|
||||
override DefinitionExt getDefinitionExt() { result = def }
|
||||
|
||||
override BasicBlock getBasicBlock() { result = def.getBasicBlock() }
|
||||
|
||||
override SourceVariable getSourceVariable() { result = def.getSourceVariable() }
|
||||
|
||||
override Location getLocation() { result = def.getLocation() }
|
||||
|
||||
override string toString() { result = def.toString() }
|
||||
@@ -1783,6 +1796,10 @@ module Make<LocationSig Location, InputSig<Location> Input> {
|
||||
|
||||
override SsaInputDefinitionExt getDefinitionExt() { result = def_ }
|
||||
|
||||
override BasicBlock getBasicBlock() { result = input_ }
|
||||
|
||||
override SourceVariable getSourceVariable() { result = def_.getSourceVariable() }
|
||||
|
||||
override Location getLocation() { result = input_.getNode(input_.length() - 1).getLocation() }
|
||||
|
||||
override string toString() { result = "[input] " + def_.toString() }
|
||||
|
||||
Reference in New Issue
Block a user