Dataflow: Replace StagePathNode.getNode with getNodeEx.

This commit is contained in:
Anders Schack-Mulligen
2024-08-20 11:45:40 +02:00
parent 9bd3f3dee0
commit bc0ae4cd1e

View File

@@ -2537,13 +2537,12 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
TStagePathNodeSinkGrp()
class StagePathNodeImpl extends TStagePathNode {
abstract NodeEx getNodeEx();
abstract string toString();
abstract Location getLocation();
/** Gets the corresponding `Node`, if any. */
Node getNode() { none() }
predicate isSource() { none() }
predicate isSink() { none() }
@@ -2557,12 +2556,16 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
override string toString() { result = "<any source>" }
override Location getLocation() { result.hasLocationInfo("", 0, 0, 0, 0) }
override NodeEx getNodeEx() { none() }
}
class StagePathNodeSinkGrp extends StagePathNodeImpl, TStagePathNodeSinkGrp {
override string toString() { result = "<any sink>" }
override Location getLocation() { result.hasLocationInfo("", 0, 0, 0, 0) }
override NodeEx getNodeEx() { none() }
}
class StagePathNodeMid extends StagePathNodeImpl, TStagePathNodeMid {
@@ -2579,6 +2582,8 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
this = TStagePathNodeMid(node, state, cc, summaryCtx, argT, argAp, t, ap)
}
override NodeEx getNodeEx() { result = node }
override string toString() {
result =
node.toString() + " " + cc.toString() + " " + t.toString() + " " + ap.toString()
@@ -2586,8 +2591,6 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
override Location getLocation() { result = node.getLocation() }
override Node getNode() { result = node.asNode() }
override predicate isSource() {
sourceNode(node, state) and
(if hasSourceCallCtx() then cc = ccSomeCall() else cc = ccNone()) and