diff options
author | Renato Golin <renato.golin@linaro.org> | 2014-01-14 22:43:43 +0000 |
---|---|---|
committer | Renato Golin <renato.golin@linaro.org> | 2014-01-14 22:43:43 +0000 |
commit | 695895ca9f39baad9ab56673a0c192e5449548fa (patch) | |
tree | 3401a37763c44ab08a228037d06e6c01db37db77 /llvm/tools/lli/RemoteMemoryManager.cpp | |
parent | 9e6e67c2ef40603e7305779dc052083b1d3aaac0 (diff) | |
download | bcm5719-llvm-695895ca9f39baad9ab56673a0c192e5449548fa.tar.gz bcm5719-llvm-695895ca9f39baad9ab56673a0c192e5449548fa.zip |
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.
llvm-svn: 199261
Diffstat (limited to 'llvm/tools/lli/RemoteMemoryManager.cpp')
-rw-r--r-- | llvm/tools/lli/RemoteMemoryManager.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/tools/lli/RemoteMemoryManager.cpp b/llvm/tools/lli/RemoteMemoryManager.cpp index 04fc40e426f..c9d426a4e68 100644 --- a/llvm/tools/lli/RemoteMemoryManager.cpp +++ b/llvm/tools/lli/RemoteMemoryManager.cpp @@ -129,7 +129,7 @@ void RemoteMemoryManager::notifyObjectLoaded(ExecutionEngine *EE, // Allocate space in the remote target. uint64_t RemoteAddr; - if (Target->allocateSpace(CurOffset, MaxAlign, RemoteAddr)) + if (!Target->allocateSpace(CurOffset, MaxAlign, RemoteAddr)) report_fatal_error(Target->getErrorMsg()); // Map the section addresses so relocations will get updated in the local @@ -155,13 +155,13 @@ bool RemoteMemoryManager::finalizeMemory(std::string *ErrMsg) { uint64_t RemoteAddr = I->first; const Allocation &Section = I->second; if (Section.IsCode) { - Target->loadCode(RemoteAddr, Section.MB.base(), Section.MB.size()); - + if (!Target->loadCode(RemoteAddr, Section.MB.base(), Section.MB.size())) + report_fatal_error(Target->getErrorMsg()); DEBUG(dbgs() << " loading code: " << Section.MB.base() << " to remote: 0x" << format("%llx", RemoteAddr) << "\n"); } else { - Target->loadData(RemoteAddr, Section.MB.base(), Section.MB.size()); - + if (!Target->loadData(RemoteAddr, Section.MB.base(), Section.MB.size())) + report_fatal_error(Target->getErrorMsg()); DEBUG(dbgs() << " loading data: " << Section.MB.base() << " to remote: 0x" << format("%llx", RemoteAddr) << "\n"); } |