1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

[MCJIT] Improve a RuntimeDyldChecker diagnostic.

When a RuntimeDyldChecker test requests an invalid operand for an instruction,
print the decoded instruction to aid diagnosis.

llvm-svn: 213202
This commit is contained in:
Lang Hames 2014-07-16 22:02:20 +00:00
parent d8b9bfa0c2
commit ddc836290a

View File

@ -233,9 +233,13 @@ namespace llvm {
std::string ErrMsg;
raw_string_ostream ErrMsgStream(ErrMsg);
ErrMsgStream << "Invalid operand index '" << format("%i", OpIdx)
<< " for instruction '" << Symbol
<< ". Instruction has only "
<< format("%i", Inst.getNumOperands()) << " operands.";
<< "' for instruction '" << Symbol
<< "'. Instruction has only "
<< format("%i", Inst.getNumOperands())
<< " operands.\nInstruction is:\n ";
Inst.dump_pretty(ErrMsgStream,
Checker.Disassembler->getContext().getAsmInfo(),
Checker.InstPrinter);
return std::make_pair(EvalResult(ErrMsgStream.str()), "");
}