From 040cc168355ab839053710f35fb039b4391ec5ec Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Mon, 12 Dec 2016 16:09:30 +0000 Subject: [ThinLTO] Import only necessary DICompileUnit fields Summary: As discussed on mailing list, for ThinLTO importing we don't need to import all the fields of the DICompileUnit. Don't import enums, macros, retained types lists. Also only import local scoped imported entities. Since we don't currently import any global variables, we also don't need to import the list of global variables (added an assert to verify none are being imported). This is being done by pre-populating the value map entries to map the unneeded metadata to nullptr. For the imported entities, we can simply replace the source module's list with a new list containing only those needed imported entities. This is done in the IRLinker constructor so that value mapping automatically does the desired mapping. Reviewers: mehdi_amini, dexonsmith, dblaikie, aprantl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D27635 llvm-svn: 289441 --- llvm/lib/Linker/LinkModules.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Linker/LinkModules.cpp') diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index cf4826f4c02..cf2c4ccf523 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -583,7 +583,8 @@ bool ModuleLinker::run() { [this](GlobalValue &GV, IRMover::ValueAdder Add) { addLazyFor(GV, Add); }, - !isPerformingImport())) { + /* LinkModuleInlineAsm */ !isPerformingImport(), + /* IsPerformingImport */ isPerformingImport())) { handleAllErrors(std::move(E), [&](ErrorInfoBase &EIB) { DstM.getContext().diagnose(LinkDiagnosticInfo(DS_Error, EIB.message())); HasErrors = true; -- cgit v1.2.3