summaryrefslogtreecommitdiffstats
path: root/llvm/tools/lli/RemoteTarget.h
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
commit695895ca9f39baad9ab56673a0c192e5449548fa (patch)
tree3401a37763c44ab08a228037d06e6c01db37db77 /llvm/tools/lli/RemoteTarget.h
parent9e6e67c2ef40603e7305779dc052083b1d3aaac0 (diff)
downloadbcm5719-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/RemoteTarget.h')
-rw-r--r--llvm/tools/lli/RemoteTarget.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/tools/lli/RemoteTarget.h b/llvm/tools/lli/RemoteTarget.h
index c95fbd1ae9e..a7d4e59e3bf 100644
--- a/llvm/tools/lli/RemoteTarget.h
+++ b/llvm/tools/lli/RemoteTarget.h
@@ -25,11 +25,13 @@
namespace llvm {
class RemoteTarget {
- std::string ErrorMsg;
bool IsRunning;
SmallVector<sys::MemoryBlock, 16> Allocations;
+protected:
+ std::string ErrorMsg;
+
public:
StringRef getErrorMsg() const { return ErrorMsg; }
@@ -39,7 +41,7 @@ public:
/// @param Alignment Required minimum alignment for allocated space.
/// @param[out] Address Remote address of the allocated memory.
///
- /// @returns False on success. On failure, ErrorMsg is updated with
+ /// @returns True on success. On failure, ErrorMsg is updated with
/// descriptive text of the encountered error.
virtual bool allocateSpace(size_t Size,
unsigned Alignment,
@@ -51,7 +53,7 @@ public:
/// @param Data Source address in the host process.
/// @param Size Number of bytes to copy.
///
- /// @returns False on success. On failure, ErrorMsg is updated with
+ /// @returns True on success. On failure, ErrorMsg is updated with
/// descriptive text of the encountered error.
virtual bool loadData(uint64_t Address,
const void *Data,
@@ -63,7 +65,7 @@ public:
/// @param Data Source address in the host process.
/// @param Size Number of bytes to copy.
///
- /// @returns False on success. On failure, ErrorMsg is updated with
+ /// @returns True on success. On failure, ErrorMsg is updated with
/// descriptive text of the encountered error.
virtual bool loadCode(uint64_t Address,
const void *Data,
@@ -76,7 +78,7 @@ public:
/// process.
/// @param[out] RetVal The integer return value of the called function.
///
- /// @returns False on success. On failure, ErrorMsg is updated with
+ /// @returns True on success. On failure, ErrorMsg is updated with
/// descriptive text of the encountered error.
virtual bool executeCode(uint64_t Address,
int &RetVal);
@@ -89,12 +91,12 @@ public:
virtual unsigned getPageAlignment() { return 4096; }
/// Start the remote process.
- virtual void create();
+ virtual bool create();
/// Terminate the remote process.
virtual void stop();
- RemoteTarget() : ErrorMsg(""), IsRunning(false) {}
+ RemoteTarget() : IsRunning(false), ErrorMsg("") {}
virtual ~RemoteTarget() { if (IsRunning) stop(); }
// Create an instance of the system-specific remote target class.
OpenPOWER on IntegriCloud