summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker/LinkModules.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-12-12 16:09:30 +0000
committerTeresa Johnson <tejohnson@google.com>2016-12-12 16:09:30 +0000
commit040cc168355ab839053710f35fb039b4391ec5ec (patch)
tree51a5302283fa314b31f1e07e9e841abceaf2af89 /llvm/lib/Linker/LinkModules.cpp
parent108044a61c0f652416ffab3d4f3a8b791fd4859f (diff)
downloadbcm5719-llvm-040cc168355ab839053710f35fb039b4391ec5ec.tar.gz
bcm5719-llvm-040cc168355ab839053710f35fb039b4391ec5ec.zip
[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
Diffstat (limited to 'llvm/lib/Linker/LinkModules.cpp')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp3
1 files changed, 2 insertions, 1 deletions
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;
OpenPOWER on IntegriCloud