Skip to content

Commit 54cadcf

Browse files
committed
C++: Forward to a cached predicate in a cached module instead of caching the predicate in 'Instruction.qll' to include it in the cached stage of the other predicates.
1 parent e44d4c4 commit 54cadcf

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/Instruction.qll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,7 @@ class Instruction extends Construction::TStageInstruction {
247247
* Gets the type of the result produced by this instruction. If the instruction does not produce
248248
* a result, its result type will be `IRVoidType`.
249249
*/
250-
cached
251-
final IRType getResultIRType() { result = this.getResultLanguageType().getIRType() }
250+
final IRType getResultIRType() { result = Construction::getInstructionResultIRType(this) }
252251

253252
/**
254253
* Gets the type of the result produced by this instruction. If the

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,11 @@ private module Cached {
429429
instr = unreachedInstruction(_) and result = Language::getVoidType()
430430
}
431431

432+
cached
433+
IRType getInstructionResultIRType(Instruction instr) {
434+
result = instr.getResultLanguageType().getIRType()
435+
}
436+
432437
/**
433438
* Holds if `opcode` is the opcode that specifies the operation performed by `instr`.
434439
*

0 commit comments

Comments
 (0)