Skip to content

Commit f5eb2d9

Browse files
committed
SSA: Use Definition.getLocation in DefinitionExt.
1 parent 5a909aa commit f5eb2d9

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

shared/ssa/codeql/ssa/Ssa.qll

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,11 +1256,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
12561256
string toString() { result = this.(Definition).toString() }
12571257

12581258
/** Gets the location of this SSA definition. */
1259-
Location getLocation() {
1260-
exists(BasicBlock bb, int i | this.definesAt(_, bb, i, _) |
1261-
if i = -1 then result = bb.getLocation() else result = bb.getNode(i).getLocation()
1262-
)
1263-
}
1259+
Location getLocation() { result = this.(Definition).getLocation() }
12641260
}
12651261

12661262
/**
@@ -1346,6 +1342,8 @@ module Make<LocationSig Location, InputSig<Location> Input> {
13461342
*/
13471343
class PhiReadNode extends DefinitionExt, TPhiReadNode {
13481344
override string toString() { result = "SSA phi read(" + this.getSourceVariable() + ")" }
1345+
1346+
override Location getLocation() { result = this.getBasicBlock().getLocation() }
13491347
}
13501348

13511349
/** Provides a set of consistency queries. */

0 commit comments

Comments
 (0)