X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=tools%2Flli%2FOrcLazyJIT.h;h=5019523c7f0e0d71f600364f885e76d6525a7147;hb=15e1e7f179e9740321df5cd9af21db5777044d9f;hp=fe86adbf95162f672398fceedbffafd45787c6a3;hpb=87663dbefa6de78c46870d7bf763db9031a3b788;p=oota-llvm.git diff --git a/tools/lli/OrcLazyJIT.h b/tools/lli/OrcLazyJIT.h index fe86adbf951..5019523c7f0 100644 --- a/tools/lli/OrcLazyJIT.h +++ b/tools/lli/OrcLazyJIT.h @@ -46,16 +46,17 @@ public: CallbackManagerBuilder; static CallbackManagerBuilder createCallbackManagerBuilder(Triple T); - - OrcLazyJIT(std::unique_ptr TM, LLVMContext &Context, - CallbackManagerBuilder &BuildCallbackMgr) - : TM(std::move(TM)), - ObjectLayer(), - CompileLayer(ObjectLayer, orc::SimpleCompiler(*this->TM)), - IRDumpLayer(CompileLayer, createDebugDumper()), - CCMgr(BuildCallbackMgr(IRDumpLayer, CCMgrMemMgr, Context)), - CODLayer(IRDumpLayer, *CCMgr, false), - CXXRuntimeOverrides([this](const std::string &S) { return mangle(S); }) {} + const DataLayout &DL; + + OrcLazyJIT(std::unique_ptr TM, const DataLayout &DL, + LLVMContext &Context, CallbackManagerBuilder &BuildCallbackMgr) + : DL(DL), TM(std::move(TM)), ObjectLayer(), + CompileLayer(ObjectLayer, orc::SimpleCompiler(*this->TM)), + IRDumpLayer(CompileLayer, createDebugDumper()), + CCMgr(BuildCallbackMgr(IRDumpLayer, CCMgrMemMgr, Context)), + CODLayer(IRDumpLayer, *CCMgr, false), + CXXRuntimeOverrides( + [this](const std::string &S) { return mangle(S); }) {} ~OrcLazyJIT() { // Run any destructors registered with __cxa_atexit. @@ -73,7 +74,7 @@ public: ModuleHandleT addModule(std::unique_ptr M) { // Attach a data-layout if one isn't already present. if (M->getDataLayout().isDefault()) - M->setDataLayout(*TM->getDataLayout()); + M->setDataLayout(DL); // Record the static constructors and destructors. We have to do this before // we hand over ownership of the module to the JIT. @@ -131,12 +132,11 @@ public: } private: - std::string mangle(const std::string &Name) { std::string MangledName; { raw_string_ostream MangledNameStream(MangledName); - Mangler::getNameWithPrefix(MangledNameStream, Name, *TM->getDataLayout()); + Mangler::getNameWithPrefix(MangledNameStream, Name, DL); } return MangledName; }