summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-04-14 21:31:46 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-04-14 21:31:46 +0000
commit03a5042e4c9fe86ea8f56d4c5f81ee38cc8fd108 (patch)
tree8222f4b4964cc77590600b7a4d5375d8339802af
parent6381713b37184a1d18e59cb02713bcd09e8e23b4 (diff)
downloadbcm5719-llvm-03a5042e4c9fe86ea8f56d4c5f81ee38cc8fd108.tar.gz
bcm5719-llvm-03a5042e4c9fe86ea8f56d4c5f81ee38cc8fd108.zip
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
-rw-r--r--lld/COFF/InputFiles.cpp3
-rw-r--r--lld/COFF/SymbolTable.cpp3
2 files changed, 2 insertions, 4 deletions
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index 3c8aab53625..088092e8ae7 100644
--- a/lld/COFF/InputFiles.cpp
+++ b/lld/COFF/InputFiles.cpp
@@ -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);
diff --git a/lld/COFF/SymbolTable.cpp b/lld/COFF/SymbolTable.cpp
index c2d943f7c9c..189c3feca73 100644
--- a/lld/COFF/SymbolTable.cpp
+++ b/lld/COFF/SymbolTable.cpp
@@ -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);
OpenPOWER on IntegriCloud