Dataflow: Refactor getLocation

This commit is contained in:
Anders Schack-Mulligen
2024-08-20 11:47:59 +02:00
parent bc0ae4cd1e
commit bdcc5e7b67

View File

@@ -2541,12 +2541,13 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
abstract string toString();
abstract Location getLocation();
predicate isSource() { none() }
predicate isSink() { none() }
/** Gets the location of this node. */
Location getLocation() { result = this.getNodeEx().getLocation() }
predicate isArbitrarySource() { this instanceof TStagePathNodeSrcGrp }
predicate isArbitrarySink() { this instanceof TStagePathNodeSinkGrp }
@@ -2589,8 +2590,6 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
node.toString() + " " + cc.toString() + " " + t.toString() + " " + ap.toString()
}
override Location getLocation() { result = node.getLocation() }
override predicate isSource() {
sourceNode(node, state) and
(if hasSourceCallCtx() then cc = ccSomeCall() else cc = ccNone()) and