Skip to content

Commit c5e2884

Browse files
committed
SSA: Remove superfluous column from liveAtRank.
1 parent b62432f commit c5e2884

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

shared/ssa/codeql/ssa/Ssa.qll

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,18 +229,17 @@ module Make<LocationSig Location, InputSig<Location> Input> {
229229
}
230230

231231
/**
232-
* Holds if variable `v` is live in basic block `bb` at index `i`.
233-
* The rank of `i` is `rnk` as defined by `refRank()`.
232+
* Holds if variable `v` is live in basic block `bb` at rank `rnk`.
234233
*/
235-
private predicate liveAtRank(BasicBlock bb, int i, SourceVariable v, int rnk) {
236-
exists(RefKind kind | rnk = refRank(bb, i, v, kind) |
234+
private predicate liveAtRank(BasicBlock bb, SourceVariable v, int rnk) {
235+
exists(RefKind kind | rnk = refRank(bb, _, v, kind) |
237236
rnk = maxRefRank(bb, v) and
238237
liveAtExit(bb, v)
239238
or
240239
kind = Read()
241240
or
242241
exists(RefKind nextKind |
243-
liveAtRank(bb, _, v, rnk + 1) and
242+
liveAtRank(bb, v, rnk + 1) and
244243
rnk + 1 = refRank(bb, _, v, nextKind) and
245244
nextKind != Write(true)
246245
)
@@ -252,7 +251,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
252251
* index `i` inside basic block `bb`.
253252
*/
254253
predicate liveAfterWrite(BasicBlock bb, int i, SourceVariable v) {
255-
exists(int rnk | rnk = refRank(bb, i, v, Write(_)) | liveAtRank(bb, i, v, rnk))
254+
exists(int rnk | rnk = refRank(bb, i, v, Write(_)) | liveAtRank(bb, v, rnk))
256255
}
257256
}
258257

0 commit comments

Comments
 (0)