Skip to content

Commit 2aabe43

Browse files
author
Dave Bartolomeo
committed
C++/C#: Stop caching getOldInstruction()
1 parent ac16993 commit 2aabe43

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SSAConstruction.qll

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ private module Cached {
6464
result.getFirstInstruction() = getNewInstruction(oldBlock.getFirstInstruction())
6565
}
6666

67-
cached
68-
OldInstruction getOldInstruction(Instruction instr) { instr = result }
69-
7067
cached
7168
predicate hasModeledMemoryResult(Instruction instruction) {
7269
exists(Alias::getResultMemoryLocation(getOldInstruction(instruction))) or
@@ -341,6 +338,8 @@ private module Cached {
341338

342339
private Instruction getNewInstruction(OldInstruction instr) { getOldInstruction(result) = instr }
343340

341+
private OldInstruction getOldInstruction(Instruction instr) { instr = result }
342+
344343
private ChiInstruction getChi(OldInstruction primaryInstr) {
345344
result = chiInstruction(_, primaryInstr)
346345
}

cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ private module Cached {
6464
result.getFirstInstruction() = getNewInstruction(oldBlock.getFirstInstruction())
6565
}
6666

67-
cached
68-
OldInstruction getOldInstruction(Instruction instr) { instr = result }
69-
7067
cached
7168
predicate hasModeledMemoryResult(Instruction instruction) {
7269
exists(Alias::getResultMemoryLocation(getOldInstruction(instruction))) or
@@ -341,6 +338,8 @@ private module Cached {
341338

342339
private Instruction getNewInstruction(OldInstruction instr) { getOldInstruction(result) = instr }
343340

341+
private OldInstruction getOldInstruction(Instruction instr) { instr = result }
342+
344343
private ChiInstruction getChi(OldInstruction primaryInstr) {
345344
result = chiInstruction(_, primaryInstr)
346345
}

csharp/ql/src/experimental/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ private module Cached {
6464
result.getFirstInstruction() = getNewInstruction(oldBlock.getFirstInstruction())
6565
}
6666

67-
cached
68-
OldInstruction getOldInstruction(Instruction instr) { instr = result }
69-
7067
cached
7168
predicate hasModeledMemoryResult(Instruction instruction) {
7269
exists(Alias::getResultMemoryLocation(getOldInstruction(instruction))) or
@@ -341,6 +338,8 @@ private module Cached {
341338

342339
private Instruction getNewInstruction(OldInstruction instr) { getOldInstruction(result) = instr }
343340

341+
private OldInstruction getOldInstruction(Instruction instr) { instr = result }
342+
344343
private ChiInstruction getChi(OldInstruction primaryInstr) {
345344
result = chiInstruction(_, primaryInstr)
346345
}

0 commit comments

Comments
 (0)