summaryrefslogtreecommitdiff
path: root/tools/lli/lli.cpp
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2014-01-14 22:43:43 +0000
committerRenato Golin <renato.golin@linaro.org>2014-01-14 22:43:43 +0000
commit83ece7a4993edb295e71841bd51b298219186c4c (patch)
tree396a100a569c18057afe5c1ed288cabf65a2c0c0 /tools/lli/lli.cpp
parent0445dc203b0e4001a153d9af4bd75f5242401d06 (diff)
downloadllvm-83ece7a4993edb295e71841bd51b298219186c4c.tar.gz
llvm-83ece7a4993edb295e71841bd51b298219186c4c.tar.bz2
llvm-83ece7a4993edb295e71841bd51b298219186c4c.tar.xz
Sanitize MCJIT remote execution
MCJIT remote execution (ChildTarget+RemoteTargetExternal) protocol was in dire need of refactoring. It was fail-prone, had no error reporting and implemented the same message logic on every single function. This patch rectifies it, and makes it work on ARM, where it was randomly failing. Other architectures shall profit from this change as well, making their buildbots and releases more reliable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199261 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lli/lli.cpp')
-rw-r--r--tools/lli/lli.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp
index 3766f8c0ca..c6db51a2b0 100644
--- a/tools/lli/lli.cpp
+++ b/tools/lli/lli.cpp
@@ -685,7 +685,10 @@ int main(int argc, char **argv, char * const *envp) {
MM->setRemoteTarget(Target.get());
// Create the remote target.
- Target->create();
+ if (!Target->create()) {
+ errs() << "ERROR: " << Target->getErrorMsg() << "\n";
+ return EXIT_FAILURE;
+ }
// Since we're executing in a (at least simulated) remote address space,
// we can't use the ExecutionEngine::runFunctionAsMain(). We have to
@@ -702,7 +705,7 @@ int main(int argc, char **argv, char * const *envp) {
DEBUG(dbgs() << "Executing '" << EntryFn->getName() << "' at 0x"
<< format("%llx", Entry) << "\n");
- if (Target->executeCode(Entry, Result))
+ if (!Target->executeCode(Entry, Result))
errs() << "ERROR: " << Target->getErrorMsg() << "\n";
// Like static constructors, the remote target MCJIT support doesn't handle