mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191843 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user