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@apple.com>
llvm-svn: 266373
This commit is contained in:
Mehdi Amini 2016-04-14 21:31:46 +00:00
parent 6381713b37
commit 03a5042e4c
2 changed files with 2 additions and 4 deletions

View File

@ -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);

View File

@ -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);