C++: use UnmodeledDefinition in UnmodeledUse

This commit is contained in:
Robert Marsh
2018-11-06 12:00:32 -08:00
committed by Dave Bartolomeo
parent 927f935e62
commit b401cd97f2
6 changed files with 163 additions and 149 deletions

View File

@@ -153,7 +153,7 @@ cached private module Cached {
else
result = getPhiInstruction(instruction.getFunction(), defBlock, vvar)
)
)
)
else (
result = instruction.getFunctionIR().getUnmodeledDefinitionInstruction()
)
@@ -168,12 +168,17 @@ cached private module Cached {
result = getNewInstruction(oldDefinition)
)
)
else
else
result = getNewInstruction(oldOperand.getDefinitionInstruction())
) or
instruction.getTag() = ChiTag(getOldInstruction(result)) and
tag instanceof ChiPartialOperandTag
or
instruction instanceof UnmodeledUseInstruction and
tag instanceof UnmodeledUseOperandTag and
result instanceof UnmodeledDefinitionInstruction and
instruction.getFunction() = result.getFunction()
or
result = getChiInstructionTotalOperand(instruction.(ChiInstruction), tag.(ChiTotalOperandTag))
}

View File

@@ -218,6 +218,11 @@ class TranslatedFunction extends TranslatedElement,
result.getFunction() = func and
result.hasMemoryResult()
) or
(
tag = UnmodeledUseTag() and
operandTag instanceof UnmodeledUseOperandTag and
result = getUnmodeledDefinitionInstruction()
) or
(
tag = ReturnTag() and
not getReturnType() instanceof VoidType and

View File

@@ -174,6 +174,11 @@ cached private module Cached {
instruction.getTag() = ChiTag(getOldInstruction(result)) and
tag instanceof ChiPartialOperandTag
or
instruction instanceof UnmodeledUseInstruction and
tag instanceof UnmodeledUseOperandTag and
result instanceof UnmodeledDefinitionInstruction and
instruction.getFunction() = result.getFunction()
or
result = getChiInstructionTotalOperand(instruction.(ChiInstruction), tag.(ChiTotalOperandTag))
}