C++: Concretize ConstantAnalysis NegateInstruction

This is just to make the QL shorter. It generates the same DIL.
This commit is contained in:
Jonas Jensen
2019-02-05 09:38:31 +01:00
parent be35c674a7
commit cad4bac548
3 changed files with 3 additions and 21 deletions

View File

@@ -6,13 +6,7 @@ language[monotonicAggregates]
int getConstantValue(Instruction instr) {
result = instr.(IntegerConstantInstruction).getValue().toInt() or
result = getBinaryInstructionValue(instr) or
exists(UnaryInstruction unaryInstr, int src |
unaryInstr = instr and
src = getConstantValue(unaryInstr.getOperand()) and
(
unaryInstr instanceof NegateInstruction and result = neg(src)
)
) or
result = neg(getConstantValue(instr.(NegateInstruction).getOperand())) or
result = getConstantValue(instr.(CopyInstruction).getSourceValue()) or
exists(PhiInstruction phi |
phi = instr and

View File

@@ -6,13 +6,7 @@ language[monotonicAggregates]
int getConstantValue(Instruction instr) {
result = instr.(IntegerConstantInstruction).getValue().toInt() or
result = getBinaryInstructionValue(instr) or
exists(UnaryInstruction unaryInstr, int src |
unaryInstr = instr and
src = getConstantValue(unaryInstr.getOperand()) and
(
unaryInstr instanceof NegateInstruction and result = neg(src)
)
) or
result = neg(getConstantValue(instr.(NegateInstruction).getOperand())) or
result = getConstantValue(instr.(CopyInstruction).getSourceValue()) or
exists(PhiInstruction phi |
phi = instr and

View File

@@ -6,13 +6,7 @@ language[monotonicAggregates]
int getConstantValue(Instruction instr) {
result = instr.(IntegerConstantInstruction).getValue().toInt() or
result = getBinaryInstructionValue(instr) or
exists(UnaryInstruction unaryInstr, int src |
unaryInstr = instr and
src = getConstantValue(unaryInstr.getOperand()) and
(
unaryInstr instanceof NegateInstruction and result = neg(src)
)
) or
result = neg(getConstantValue(instr.(NegateInstruction).getOperand())) or
result = getConstantValue(instr.(CopyInstruction).getSourceValue()) or
exists(PhiInstruction phi |
phi = instr and