diff options
| author | Andrew Kaylor <andrew.kaylor@intel.com> | 2013-10-02 17:12:36 +0000 |
|---|---|---|
| committer | Andrew Kaylor <andrew.kaylor@intel.com> | 2013-10-02 17:12:36 +0000 |
| commit | c2ebf3f51777031b3fc5169708ef244ce8c2d5a5 (patch) | |
| tree | cebf7d9a4f478561c1f7a1fd417736bb59c67e47 /llvm/tools/lli/RemoteTarget.cpp | |
| parent | 182486c9d973d94e8ccc237e74a52a4b7a5fb593 (diff) | |
| download | bcm5719-llvm-c2ebf3f51777031b3fc5169708ef244ce8c2d5a5.tar.gz bcm5719-llvm-c2ebf3f51777031b3fc5169708ef244ce8c2d5a5.zip | |
Adding out-of-process execution support to lli.
At this time only Unix-based systems are supported. Windows has stubs and should re-route to the simulated mode.
Thanks to Sriram Murali for contributions to this patch.
llvm-svn: 191843
Diffstat (limited to 'llvm/tools/lli/RemoteTarget.cpp')
| -rw-r--r-- | llvm/tools/lli/RemoteTarget.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/llvm/tools/lli/RemoteTarget.cpp b/llvm/tools/lli/RemoteTarget.cpp index 212bdfda1cd..5c74e6e7a04 100644 --- a/llvm/tools/lli/RemoteTarget.cpp +++ b/llvm/tools/lli/RemoteTarget.cpp @@ -13,13 +13,44 @@ //===----------------------------------------------------------------------===// #include "RemoteTarget.h" +#include "RemoteTargetExternal.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/DataTypes.h" #include "llvm/Support/Memory.h" #include <stdlib.h> #include <string> + using namespace llvm; +// Static methods +RemoteTarget *RemoteTarget::createRemoteTarget() { + return new RemoteTarget; +} + +RemoteTarget *RemoteTarget::createExternalRemoteTarget(std::string &ChildName) { +#ifdef LLVM_ON_UNIX + return new RemoteTargetExternal(ChildName); +#else + return 0; +#endif +} + +bool RemoteTarget::hostSupportsExternalRemoteTarget() { +#ifdef LLVM_ON_UNIX + return true; +#else + return false; +#endif +} + + +//////////////////////////////////////////////////////////////////////////////// +// Simulated remote execution +// +// This implementation will simply move generated code and data to a new memory +// location in the current executable and let it run from there. +//////////////////////////////////////////////////////////////////////////////// + bool RemoteTarget::allocateSpace(size_t Size, unsigned Alignment, uint64_t &Address) { sys::MemoryBlock *Prev = Allocations.size() ? &Allocations.back() : NULL; |

