diff --git a/include/cling/Interpreter/Interpreter.h b/include/cling/Interpreter/Interpreter.h index fe9aae30..b2d3131e 100644 --- a/include/cling/Interpreter/Interpreter.h +++ b/include/cling/Interpreter/Interpreter.h @@ -334,12 +334,10 @@ namespace cling { /// ///\param[in] NoRuntime - Don't include the runtime headers / gCling ///\param[in] SyntaxOnly - In SyntaxOnly mode - ///\param[out] Globals - Global symbols that need to be emitted /// ///\returns The resulting Transation of initialization. /// - Transaction* Initialize(bool NoRuntime, bool SyntaxOnly, - llvm::SmallVectorImpl& Globals); + Transaction* Initialize(bool NoRuntime, bool SyntaxOnly); ///\ Shut down the interpreter runtime. /// diff --git a/lib/Interpreter/Interpreter.cpp b/lib/Interpreter/Interpreter.cpp index f6582ad1..4cfed18b 100644 --- a/lib/Interpreter/Interpreter.cpp +++ b/lib/Interpreter/Interpreter.cpp @@ -327,8 +327,7 @@ namespace cling { setupCallbacks(*this, parentInterp); } - llvm::SmallVector Syms; - Initialize(noRuntime || m_Opts.NoRuntime, isInSyntaxOnlyMode(), Syms); + Initialize(noRuntime || m_Opts.NoRuntime, isInSyntaxOnlyMode()); // Commit the transactions, now that gCling is set up. It is needed for // static initialization in these transactions through @@ -336,24 +335,6 @@ namespace cling { for (auto&& I: IncrParserTransactions) m_IncrParser->commitTransaction(I); - // Now that the transactions have been commited, force symbol emission - // and overrides. - if (!isInSyntaxOnlyMode() && !m_Opts.CompilerOpts.CUDADevice) { - for (const llvm::StringRef& Sym : Syms) { - void* Addr = m_Executor->getPointerToGlobalFromJIT(Sym); -#if defined(__linux__) - // We need to look for the mangled name of at_quick_exit on linux. - if (!Addr && Sym.equals("at_quick_exit")) - Addr = m_Executor->getPointerToGlobalFromJIT("_Z13at_quick_exitPFvvE"); -#endif - if (!Addr) { - cling::errs() << "Replaced symbol " << Sym << " cannot be found in JIT!\n"; - } else { - m_Executor->replaceSymbol(Sym.str().c_str(), Addr); - } - } - } - m_IncrParser->SetTransformers(parentInterp); if (!TSCtx->getContext()) { @@ -423,8 +404,7 @@ namespace cling { m_IncrParser.reset(nullptr); } - Transaction* Interpreter::Initialize(bool NoRuntime, bool SyntaxOnly, - llvm::SmallVectorImpl& Globals) { + Transaction* Interpreter::Initialize(bool NoRuntime, bool SyntaxOnly) { // The Initialize() function is called twice in CUDA mode. The first time // the host interpreter is initialized and the second time the device // interpreter is initialized. Without this if statement, a redefinition @@ -521,7 +501,6 @@ namespace cling { << " { return __cxa_atexit((void(*)(void*))f, 0, __dso_handle); }\n"; else Strm << ";\n"; - Globals.push_back("at_quick_exit"); } #if defined(_WIN32) @@ -539,7 +518,6 @@ namespace cling { " return f; }\n"; else Strm << ";\n"; - Globals.push_back("__dllonexit"); #if !defined(_M_CEE_PURE) Strm << Linkage << " " << Spec << " int (*_onexit(" << "int (" << Spec << " *f)()))()"; @@ -548,7 +526,6 @@ namespace cling { " return f; }\n"; else Strm << ";\n"; - Globals.push_back("_onexit"); #endif #endif