[lld] r266373 - Revert "Do not use llvm::getGlobalContext(), trying to nuke it from LLVM"
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 14 14:31:47 PDT 2016
Author: mehdi_amini
Date: Thu Apr 14 16:31:46 2016
New Revision: 266373
URL: http://llvm.org/viewvc/llvm-project?rev=266373&view=rev
Log:
Revert "Do not use llvm::getGlobalContext(), trying to nuke it from LLVM"
This reverts commit r266365 and r266367, the contexts in the two
places have to match.
From: Mehdi Amini <mehdi.amini at apple.com>
Modified:
lld/trunk/COFF/InputFiles.cpp
lld/trunk/COFF/SymbolTable.cpp
Modified: lld/trunk/COFF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/InputFiles.cpp?rev=266373&r1=266372&r2=266373&view=diff
==============================================================================
--- lld/trunk/COFF/InputFiles.cpp (original)
+++ lld/trunk/COFF/InputFiles.cpp Thu Apr 14 16:31:46 2016
@@ -320,9 +320,8 @@ void BitcodeFile::parse() {
// Usually parse() is thread-safe, but bitcode file is an exception.
std::lock_guard<std::mutex> Lock(Mu);
- llvm::LLVMContext Context;
ErrorOr<std::unique_ptr<LTOModule>> ModOrErr =
- LTOModule::createFromBuffer(Context, MB.getBufferStart(),
+ LTOModule::createFromBuffer(llvm::getGlobalContext(), MB.getBufferStart(),
MB.getBufferSize(), llvm::TargetOptions());
error(ModOrErr, "Could not create lto module");
M = std::move(*ModOrErr);
Modified: lld/trunk/COFF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/SymbolTable.cpp?rev=266373&r1=266372&r2=266373&view=diff
==============================================================================
--- lld/trunk/COFF/SymbolTable.cpp (original)
+++ lld/trunk/COFF/SymbolTable.cpp Thu Apr 14 16:31:46 2016
@@ -369,8 +369,7 @@ void SymbolTable::addCombinedLTOObjects(
// Create an object file and add it to the symbol table by replacing any
// DefinedBitcode symbols with the definitions in the object file.
- LLVMContext Context;
- LTOCodeGenerator CG(Context);
+ LTOCodeGenerator CG(getGlobalContext());
CG.setOptLevel(Config->LTOOptLevel);
std::vector<ObjectFile *> Objs = createLTOObjects(&CG);
More information about the llvm-commits
mailing list