mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
C++:/C# Remove opcode from TRawInstruction
This commit is contained in:
@@ -15,10 +15,10 @@ private import Imports::Opcode
|
||||
cached
|
||||
newtype TInstruction =
|
||||
TRawInstruction(
|
||||
Opcode opcode, IRConstruction::Raw::InstructionTag1 tag1,
|
||||
IRConstruction::Raw::InstructionTag1 tag1,
|
||||
IRConstruction::Raw::InstructionTag2 tag2
|
||||
) {
|
||||
IRConstruction::Raw::hasInstruction(opcode, tag1, tag2)
|
||||
IRConstruction::Raw::hasInstruction(tag1, tag2)
|
||||
} or
|
||||
TUnaliasedSSAPhiInstruction(
|
||||
TRawInstruction blockStartInstr,
|
||||
|
||||
@@ -15,11 +15,11 @@ private import TranslatedStmt
|
||||
private import TranslatedFunction
|
||||
|
||||
TranslatedElement getInstructionTranslatedElement(Instruction instruction) {
|
||||
instruction = TRawInstruction(_, result, _)
|
||||
instruction = TRawInstruction(result, _)
|
||||
}
|
||||
|
||||
InstructionTag getInstructionTag(Instruction instruction) {
|
||||
instruction = TRawInstruction(_, _, result)
|
||||
instruction = TRawInstruction(_, result)
|
||||
}
|
||||
|
||||
pragma[noinline]
|
||||
@@ -44,8 +44,8 @@ module Raw {
|
||||
predicate functionHasIR(Function func) { exists(getTranslatedFunction(func)) }
|
||||
|
||||
cached
|
||||
predicate hasInstruction(Opcode opcode, TranslatedElement element, InstructionTag tag) {
|
||||
element.hasInstruction(opcode, tag, _)
|
||||
predicate hasInstruction(TranslatedElement element, InstructionTag tag) {
|
||||
element.hasInstruction(_, tag, _)
|
||||
}
|
||||
|
||||
cached
|
||||
@@ -379,7 +379,10 @@ private module Cached {
|
||||
|
||||
cached
|
||||
Opcode getInstructionOpcode(TStageInstruction instr) {
|
||||
instr = TRawInstruction(result, _, _)
|
||||
exists(TranslatedElement element, InstructionTag tag |
|
||||
instructionOrigin(instr, element, tag) and
|
||||
element.hasInstruction(result, tag, _)
|
||||
)
|
||||
}
|
||||
|
||||
cached
|
||||
|
||||
Reference in New Issue
Block a user