[lld] r254725 - Update for llvm change.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 4 08:22:10 PST 2015
Author: rafael
Date: Fri Dec 4 10:22:09 2015
New Revision: 254725
URL: http://llvm.org/viewvc/llvm-project?rev=254725&view=rev
Log:
Update for llvm change.
Modified:
lld/trunk/COFF/InputFiles.cpp
Modified: lld/trunk/COFF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/InputFiles.cpp?rev=254725&r1=254724&r2=254725&view=diff
==============================================================================
--- lld/trunk/COFF/InputFiles.cpp (original)
+++ lld/trunk/COFF/InputFiles.cpp Fri Dec 4 10:22:09 2015
@@ -12,6 +12,7 @@
#include "InputFiles.h"
#include "Symbols.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/IR/LLVMContext.h"
#include "llvm/LTO/LTOModule.h"
#include "llvm/Object/COFF.h"
#include "llvm/Support/COFF.h"
@@ -315,12 +316,11 @@ void BitcodeFile::parse() {
// Usually parse() is thread-safe, but bitcode file is an exception.
std::lock_guard<std::mutex> Lock(Mu);
- std::string Err;
- M.reset(LTOModule::createFromBuffer(MB.getBufferStart(),
- MB.getBufferSize(),
- llvm::TargetOptions(), Err));
- if (!Err.empty())
- error(Err);
+ ErrorOr<std::unique_ptr<LTOModule>> ModOrErr =
+ LTOModule::createFromBuffer(llvm::getGlobalContext(), MB.getBufferStart(),
+ MB.getBufferSize(), llvm::TargetOptions());
+ error(ModOrErr, "Could not create lto module");
+ M = std::move(*ModOrErr);
llvm::StringSaver Saver(Alloc);
for (unsigned I = 0, E = M->getSymbolCount(); I != E; ++I) {
More information about the llvm-commits
mailing list