summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2014-07-16 22:02:20 +0000
committerLang Hames <lhames@gmail.com>2014-07-16 22:02:20 +0000
commit8b205306892ea701978a2b789f6eafe4277648a7 (patch)
tree9a5491e0b9fb357923e03cbe2275eed7a40db80b /llvm/lib/ExecutionEngine
parent5332411cd7464979fe6ee2e7bf48f87fb8055f96 (diff)
downloadbcm5719-llvm-8b205306892ea701978a2b789f6eafe4277648a7.tar.gz
bcm5719-llvm-8b205306892ea701978a2b789f6eafe4277648a7.zip
[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
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
index b10ec360aa5..1e63d9207f7 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
@@ -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()), "");
}
OpenPOWER on IntegriCloud