Do not use llvm::getGlobalContext(), trying to nuke it from LLVM
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266365
This commit is contained in:
parent
7f0b727235
commit
f1e7ff9d0e
|
@ -320,8 +320,9 @@ void BitcodeFile::parse() {
|
|||
// Usually parse() is thread-safe, but bitcode file is an exception.
|
||||
std::lock_guard<std::mutex> Lock(Mu);
|
||||
|
||||
LLVMContext Context;
|
||||
ErrorOr<std::unique_ptr<LTOModule>> ModOrErr =
|
||||
LTOModule::createFromBuffer(llvm::getGlobalContext(), MB.getBufferStart(),
|
||||
LTOModule::createFromBuffer(Context, MB.getBufferStart(),
|
||||
MB.getBufferSize(), llvm::TargetOptions());
|
||||
error(ModOrErr, "Could not create lto module");
|
||||
M = std::move(*ModOrErr);
|
||||
|
|
|
@ -369,7 +369,8 @@ 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.
|
||||
LTOCodeGenerator CG(getGlobalContext());
|
||||
LLVMContext Context;
|
||||
LTOCodeGenerator CG(Context);
|
||||
CG.setOptLevel(Config->LTOOptLevel);
|
||||
std::vector<ObjectFile *> Objs = createLTOObjects(&CG);
|
||||
|
||||
|
|
Loading…
Reference in New Issue