diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2016-12-14 01:17:59 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2016-12-14 01:17:59 +0000 |
commit | 1a0720e8c4ea8a6e66a29483fd1416f3e284b3a3 (patch) | |
tree | 6337a922fbda9d6296f18516ed90fa355072f0fb /llvm/lib/LTO/LTOBackend.cpp | |
parent | 8fec3da00ce186f06dbbf08ff4f38cd90f079308 (diff) | |
download | bcm5719-llvm-1a0720e8c4ea8a6e66a29483fd1416f3e284b3a3.tar.gz bcm5719-llvm-1a0720e8c4ea8a6e66a29483fd1416f3e284b3a3.zip |
LTO: Add support for multi-module bitcode files.
Differential Revision: https://reviews.llvm.org/D27313
llvm-svn: 289621
Diffstat (limited to 'llvm/lib/LTO/LTOBackend.cpp')
-rw-r--r-- | llvm/lib/LTO/LTOBackend.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp index ad76e717981..9d4cbdde3ff 100644 --- a/llvm/lib/LTO/LTOBackend.cpp +++ b/llvm/lib/LTO/LTOBackend.cpp @@ -318,7 +318,7 @@ Error lto::thinBackend(Config &Conf, unsigned Task, AddStreamFn AddStream, Module &Mod, ModuleSummaryIndex &CombinedIndex, const FunctionImporter::ImportMapTy &ImportList, const GVSummaryMapTy &DefinedGlobals, - MapVector<StringRef, MemoryBufferRef> &ModuleMap) { + MapVector<StringRef, BitcodeModule> &ModuleMap) { Expected<const Target *> TOrErr = initAndLookupTarget(Conf, Mod); if (!TOrErr) return TOrErr.takeError(); @@ -353,8 +353,10 @@ Error lto::thinBackend(Config &Conf, unsigned Task, AddStreamFn AddStream, auto ModuleLoader = [&](StringRef Identifier) { assert(Mod.getContext().isODRUniquingDebugTypes() && "ODR Type uniquing should be enabled on the context"); - return getLazyBitcodeModule(ModuleMap[Identifier], Mod.getContext(), - /*ShouldLazyLoadMetadata=*/true); + auto I = ModuleMap.find(Identifier); + assert(I != ModuleMap.end()); + return I->second.getLazyModule(Mod.getContext(), + /*ShouldLazyLoadMetadata=*/true); }; FunctionImporter Importer(CombinedIndex, ModuleLoader); |