summaryrefslogtreecommitdiff
path: root/lib/LTO
diff options
context:
space:
mode:
Diffstat (limited to 'lib/LTO')
-rw-r--r--lib/LTO/LTOModule.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/LTO/LTOModule.cpp b/lib/LTO/LTOModule.cpp
index 49f95a6402..dcfd59e752 100644
--- a/lib/LTO/LTOModule.cpp
+++ b/lib/LTO/LTOModule.cpp
@@ -135,12 +135,14 @@ LTOModule *LTOModule::makeLTOModule(MemoryBuffer *buffer,
TargetOptions options,
std::string &errMsg) {
// parse bitcode buffer
- OwningPtr<Module> m(getLazyBitcodeModule(buffer, getGlobalContext(),
- &errMsg));
- if (!m) {
+ ErrorOr<Module *> ModuleOrErr =
+ getLazyBitcodeModule(buffer, getGlobalContext());
+ if (error_code EC = ModuleOrErr.getError()) {
+ errMsg = EC.message();
delete buffer;
return NULL;
}
+ OwningPtr<Module> m(ModuleOrErr.get());
std::string TripleStr = m->getTargetTriple();
if (TripleStr.empty())