summaryrefslogtreecommitdiff
path: root/lib/LTO/LTO.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
commit23137e57a73d3cb71d3fb9762abc0395eb17e824 (patch)
treedaf0915c56c53fec955f29eecdc6f753d54c2761 /lib/LTO/LTO.cpp
parentd616cee95a399389d9d815e997a5be950a9801fb (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289441 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/LTO/LTO.cpp')
-rw-r--r--lib/LTO/LTO.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/LTO/LTO.cpp b/lib/LTO/LTO.cpp
index 108b5a42d75..1fd2ccf7deb 100644
--- a/lib/LTO/LTO.cpp
+++ b/lib/LTO/LTO.cpp
@@ -409,7 +409,8 @@ Error LTO::addRegularLTO(std::unique_ptr<InputFile> Input,
return RegularLTO.Mover->move(Obj->takeModule(), Keep,
[](GlobalValue &, IRMover::ValueAdder) {},
- /* LinkModuleInlineAsm */ true);
+ /* LinkModuleInlineAsm */ true,
+ /* IsPerformingImport */ false);
}
// Add a ThinLTO object to the link.