diff options
Diffstat (limited to 'llvm/lib/LTO')
-rw-r--r-- | llvm/lib/LTO/LTO.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/LTO/LTOBackend.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/LTO/ThinLTOCodeGenerator.cpp | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp index ed95ac6598c..b599830d092 100644 --- a/llvm/lib/LTO/LTO.cpp +++ b/llvm/lib/LTO/LTO.cpp @@ -350,7 +350,8 @@ Error LTO::addRegularLTO(std::unique_ptr<InputFile> Input, std::unique_ptr<object::IRObjectFile> Obj = std::move(*ObjOrErr); Module &M = Obj->getModule(); - M.materializeMetadata(); + if (Error Err = M.materializeMetadata()) + return Err; UpgradeDebugInfo(M); SmallPtrSet<GlobalValue *, 8> Used; diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp index 0885c0b8484..fb1cfed96bb 100644 --- a/llvm/lib/LTO/LTOBackend.cpp +++ b/llvm/lib/LTO/LTOBackend.cpp @@ -359,7 +359,8 @@ Error lto::thinBackend(Config &Conf, unsigned Task, AddStreamFn AddStream, }; FunctionImporter Importer(CombinedIndex, ModuleLoader); - Importer.importFunctions(Mod, ImportList); + if (Error Err = Importer.importFunctions(Mod, ImportList).takeError()) + return Err; if (Conf.PostImportModuleHook && !Conf.PostImportModuleHook(Task, Mod)) return Error(); diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp index 2bf4f7a569f..5baecc2bdac 100644 --- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp +++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp @@ -152,7 +152,8 @@ crossImportIntoModule(Module &TheModule, const ModuleSummaryIndex &Index, const FunctionImporter::ImportMapTy &ImportList) { ModuleLoader Loader(TheModule.getContext(), ModuleMap); FunctionImporter Importer(Index, Loader); - Importer.importFunctions(TheModule, ImportList); + if (!Importer.importFunctions(TheModule, ImportList)) + report_fatal_error("importFunctions failed"); } static void optimizeModule(Module &TheModule, TargetMachine &TM) { |