C++: add function info to duplicateChiOperand

This commit is contained in:
Robert Marsh
2019-10-16 15:59:00 -07:00
parent b60e7c204d
commit 6cef936046
5 changed files with 45 additions and 5 deletions

View File

@@ -120,7 +120,15 @@ module InstructionSanity {
)
}
query predicate duplicateChiOperand(ChiInstruction chi) { chi.getTotal() = chi.getPartial() }
query predicate duplicateChiOperand(
ChiInstruction chi, string message, IRFunction func, string funcText
) {
chi.getTotal() = chi.getPartial() and
message = "Chi instruction for " + chi.getPartial().toString() +
" has duplicate operands in function $@" and
func = chi.getEnclosingIRFunction() and
funcText = Language::getIdentityString(func.getFunction())
}
/**
* Holds if an instruction, other than `ExitFunction`, has no successors.

View File

@@ -120,7 +120,15 @@ module InstructionSanity {
)
}
query predicate duplicateChiOperand(ChiInstruction chi) { chi.getTotal() = chi.getPartial() }
query predicate duplicateChiOperand(
ChiInstruction chi, string message, IRFunction func, string funcText
) {
chi.getTotal() = chi.getPartial() and
message = "Chi instruction for " + chi.getPartial().toString() +
" has duplicate operands in function $@" and
func = chi.getEnclosingIRFunction() and
funcText = Language::getIdentityString(func.getFunction())
}
/**
* Holds if an instruction, other than `ExitFunction`, has no successors.

View File

@@ -120,7 +120,15 @@ module InstructionSanity {
)
}
query predicate duplicateChiOperand(ChiInstruction chi) { chi.getTotal() = chi.getPartial() }
query predicate duplicateChiOperand(
ChiInstruction chi, string message, IRFunction func, string funcText
) {
chi.getTotal() = chi.getPartial() and
message = "Chi instruction for " + chi.getPartial().toString() +
" has duplicate operands in function $@" and
func = chi.getEnclosingIRFunction() and
funcText = Language::getIdentityString(func.getFunction())
}
/**
* Holds if an instruction, other than `ExitFunction`, has no successors.