[MCJIT] Unique-ptrify the RTDyldMemoryManager member of MCJIT. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223183 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Lang Hames
2014-12-03 00:51:19 +00:00
parent 1dce7b19a0
commit 5ab94e7135
8 changed files with 51 additions and 29 deletions

View File

@ -138,10 +138,11 @@ protected:
/// getMemoryforGV - Allocate memory for a global variable.
virtual char *getMemoryForGV(const GlobalVariable *GV);
static ExecutionEngine *(*MCJITCtor)(std::unique_ptr<Module> M,
std::string *ErrorStr,
RTDyldMemoryManager *MCJMM,
std::unique_ptr<TargetMachine> TM);
static ExecutionEngine *(*MCJITCtor)(
std::unique_ptr<Module> M,
std::string *ErrorStr,
std::unique_ptr<RTDyldMemoryManager> MCJMM,
std::unique_ptr<TargetMachine> TM);
static ExecutionEngine *(*InterpCtor)(std::unique_ptr<Module> M,
std::string *ErrorStr);
@ -492,7 +493,7 @@ private:
EngineKind::Kind WhichEngine;
std::string *ErrorStr;
CodeGenOpt::Level OptLevel;
RTDyldMemoryManager *MCJMM;
std::unique_ptr<RTDyldMemoryManager> MCJMM;
TargetOptions Options;
Reloc::Model RelocModel;
CodeModel::Model CMModel;
@ -506,9 +507,10 @@ private:
public:
/// Constructor for EngineBuilder.
EngineBuilder(std::unique_ptr<Module> M) : M(std::move(M)) {
InitEngine();
}
EngineBuilder(std::unique_ptr<Module> M);
// Out-of-line since we don't have the def'n of RTDyldMemoryManager here.
~EngineBuilder();
/// setEngineKind - Controls whether the user wants the interpreter, the JIT,
/// or whichever engine works. This option defaults to EngineKind::Either.
@ -523,10 +525,7 @@ public:
/// to create anything other than MCJIT will cause a runtime error. If create()
/// is called and is successful, the created engine takes ownership of the
/// memory manager. This option defaults to NULL.
EngineBuilder &setMCJITMemoryManager(RTDyldMemoryManager *mcjmm) {
MCJMM = mcjmm;
return *this;
}
EngineBuilder &setMCJITMemoryManager(std::unique_ptr<RTDyldMemoryManager> mcjmm);
/// setErrorStr - Set the error string to write to on error. This option
/// defaults to NULL.