X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=tools%2Flli%2FRemoteMemoryManager.h;h=5733fa53f3e43a4ca7978754a92b68af9ad3bfb0;hb=813f44a29fd0fd140127023222d0633e23783bcc;hp=b9691f44705f27042dcddb1db66c308afc4783cf;hpb=9f20a4c6cea7315af0e01ac58e5fdbb9c0eb8006;p=oota-llvm.git diff --git a/tools/lli/RemoteMemoryManager.h b/tools/lli/RemoteMemoryManager.h index b9691f44705..5733fa53f3e 100644 --- a/tools/lli/RemoteMemoryManager.h +++ b/tools/lli/RemoteMemoryManager.h @@ -12,20 +12,20 @@ // //===----------------------------------------------------------------------===// -#ifndef REMOTEMEMORYMANAGER_H -#define REMOTEMEMORYMANAGER_H +#ifndef LLVM_TOOLS_LLI_REMOTEMEMORYMANAGER_H +#define LLVM_TOOLS_LLI_REMOTEMEMORYMANAGER_H #include "RemoteTarget.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" -#include "llvm/ExecutionEngine/JITMemoryManager.h" +#include "llvm/ExecutionEngine/RTDyldMemoryManager.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Memory.h" #include namespace llvm { -class RemoteMemoryManager : public JITMemoryManager { +class RemoteMemoryManager : public RTDyldMemoryManager { public: // Notice that this structure takes ownership of the memory allocated. struct Allocation { @@ -63,49 +63,37 @@ private: RemoteTarget *Target; public: - RemoteMemoryManager() : Target(NULL) {} - virtual ~RemoteMemoryManager(); + RemoteMemoryManager() : Target(nullptr) {} + ~RemoteMemoryManager() override; uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, - unsigned SectionID, StringRef SectionName); + unsigned SectionID, + StringRef SectionName) override; uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName, - bool IsReadOnly); + bool IsReadOnly) override; // For now, remote symbol resolution is not support in lli. The MCJIT // interface does support this, but clients must provide their own // mechanism for finding remote symbol addresses. MCJIT will resolve // symbols from Modules it contains. - uint64_t getSymbolAddress(const std::string &Name) { return 0; } + uint64_t getSymbolAddress(const std::string &Name) override { return 0; } - void notifyObjectLoaded(ExecutionEngine *EE, const ObjectImage *Obj); + void notifyObjectLoaded(ExecutionEngine *EE, + const object::ObjectFile &Obj) override; - bool finalizeMemory(std::string *ErrMsg); + bool finalizeMemory(std::string *ErrMsg) override; // For now, remote EH frame registration isn't supported. Remote symbol // resolution is a prerequisite to supporting remote EH frame registration. - void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size) {} - void deregisterEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size) {} + void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr, + size_t Size) override {} + void deregisterEHFrames(uint8_t *Addr, uint64_t LoadAddr, + size_t Size) override {} // This is a non-interface function used by lli void setRemoteTarget(RemoteTarget *T) { Target = T; } - - // The following obsolete JITMemoryManager calls are stubbed out for - // this model. - void setMemoryWritable(); - void setMemoryExecutable(); - void setPoisonMemory(bool poison); - void AllocateGOT(); - uint8_t *getGOTBase() const; - uint8_t *startFunctionBody(const Function *F, uintptr_t &ActualSize); - uint8_t *allocateStub(const GlobalValue* F, unsigned StubSize, - unsigned Alignment); - void endFunctionBody(const Function *F, uint8_t *FunctionStart, - uint8_t *FunctionEnd); - uint8_t *allocateSpace(intptr_t Size, unsigned Alignment); - uint8_t *allocateGlobal(uintptr_t Size, unsigned Alignment); - void deallocateFunctionBody(void *Body); }; } // end namespace llvm