C++: Rename a couple predicates based on PR feedback

This commit is contained in:
Dave Bartolomeo
2018-10-26 14:38:34 -07:00
parent f278f4fa47
commit 459b05d875
6 changed files with 15 additions and 12 deletions

View File

@@ -7,10 +7,10 @@ private import semmle.code.cpp.ir.internal.OperandTag
private newtype TOperand =
TNonPhiOperand(Instruction instr, OperandTag tag, Instruction defInstr) {
defInstr = Construction::getInstructionOperand(instr, tag)
defInstr = Construction::getInstructionOperandDefinition(instr, tag)
} or
TPhiOperand(PhiInstruction instr, Instruction defInstr, IRBlock predecessorBlock) {
defInstr = Construction::getPhiInstructionOperand(instr, predecessorBlock)
defInstr = Construction::getPhiInstructionOperandDefinition(instr, predecessorBlock)
}
/**

View File

@@ -110,7 +110,7 @@ cached private module Cached {
instruction instanceof PhiInstruction // Phis always have modeled results
}
cached Instruction getInstructionOperand(Instruction instruction, OperandTag tag) {
cached Instruction getInstructionOperandDefinition(Instruction instruction, OperandTag tag) {
exists(OldIR::Instruction oldInstruction, OldIR::NonPhiOperand oldOperand |
oldInstruction = getOldInstruction(instruction) and
oldOperand = oldInstruction.getAnOperand() and
@@ -149,7 +149,8 @@ cached private module Cached {
)
}
cached Instruction getPhiInstructionOperand(PhiInstruction instr, IRBlock newPredecessorBlock) {
cached Instruction getPhiInstructionOperandDefinition(PhiInstruction instr,
IRBlock newPredecessorBlock) {
exists(Alias::VirtualVariable vvar, OldIR::IRBlock phiBlock,
OldIR::IRBlock defBlock, int defRank, int defIndex, OldIR::IRBlock predBlock |
hasPhiNode(vvar, phiBlock) and

View File

@@ -7,10 +7,10 @@ private import semmle.code.cpp.ir.internal.OperandTag
private newtype TOperand =
TNonPhiOperand(Instruction instr, OperandTag tag, Instruction defInstr) {
defInstr = Construction::getInstructionOperand(instr, tag)
defInstr = Construction::getInstructionOperandDefinition(instr, tag)
} or
TPhiOperand(PhiInstruction instr, Instruction defInstr, IRBlock predecessorBlock) {
defInstr = Construction::getPhiInstructionOperand(instr, predecessorBlock)
defInstr = Construction::getPhiInstructionOperandDefinition(instr, predecessorBlock)
}
/**

View File

@@ -86,12 +86,13 @@ cached private module Cached {
)
}
cached Instruction getInstructionOperand(Instruction instruction, OperandTag tag) {
cached Instruction getInstructionOperandDefinition(Instruction instruction, OperandTag tag) {
result = getInstructionTranslatedElement(instruction).getInstructionOperand(
instruction.getTag(), tag)
}
cached Instruction getPhiInstructionOperand(Instruction instruction, IRBlock predecessorBlock) {
cached Instruction getPhiInstructionOperandDefinition(Instruction instruction,
IRBlock predecessorBlock) {
none()
}

View File

@@ -7,10 +7,10 @@ private import semmle.code.cpp.ir.internal.OperandTag
private newtype TOperand =
TNonPhiOperand(Instruction instr, OperandTag tag, Instruction defInstr) {
defInstr = Construction::getInstructionOperand(instr, tag)
defInstr = Construction::getInstructionOperandDefinition(instr, tag)
} or
TPhiOperand(PhiInstruction instr, Instruction defInstr, IRBlock predecessorBlock) {
defInstr = Construction::getPhiInstructionOperand(instr, predecessorBlock)
defInstr = Construction::getPhiInstructionOperandDefinition(instr, predecessorBlock)
}
/**

View File

@@ -110,7 +110,7 @@ cached private module Cached {
instruction instanceof PhiInstruction // Phis always have modeled results
}
cached Instruction getInstructionOperand(Instruction instruction, OperandTag tag) {
cached Instruction getInstructionOperandDefinition(Instruction instruction, OperandTag tag) {
exists(OldIR::Instruction oldInstruction, OldIR::NonPhiOperand oldOperand |
oldInstruction = getOldInstruction(instruction) and
oldOperand = oldInstruction.getAnOperand() and
@@ -149,7 +149,8 @@ cached private module Cached {
)
}
cached Instruction getPhiInstructionOperand(PhiInstruction instr, IRBlock newPredecessorBlock) {
cached Instruction getPhiInstructionOperandDefinition(PhiInstruction instr,
IRBlock newPredecessorBlock) {
exists(Alias::VirtualVariable vvar, OldIR::IRBlock phiBlock,
OldIR::IRBlock defBlock, int defRank, int defIndex, OldIR::IRBlock predBlock |
hasPhiNode(vvar, phiBlock) and