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.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-04-26 13:44:45 +01:00
parent e44d4c45aa
commit 54cadcfe9b
2 changed files with 6 additions and 2 deletions

View File

@@ -247,8 +247,7 @@ class Instruction extends Construction::TStageInstruction {
* Gets the type of the result produced by this instruction. If the instruction does not produce
* a result, its result type will be `IRVoidType`.
*/
cached
final IRType getResultIRType() { result = this.getResultLanguageType().getIRType() }
final IRType getResultIRType() { result = Construction::getInstructionResultIRType(this) }
/**
* Gets the type of the result produced by this instruction. If the

View File

@@ -429,6 +429,11 @@ private module Cached {
instr = unreachedInstruction(_) and result = Language::getVoidType()
}
cached
IRType getInstructionResultIRType(Instruction instr) {
result = instr.getResultLanguageType().getIRType()
}
/**
* Holds if `opcode` is the opcode that specifies the operation performed by `instr`.
*