aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2017-06-15 17:26:13 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2017-06-15 17:26:13 +0000
commitdbd2fed6a1a1ae2efb64255fdd0e07a04a2d1f13 (patch)
tree5b04d233e36a1de3205dcd20c07e890c20fb76c0 /clang/lib/CodeGen/BackendUtil.cpp
parent587525468d4fc61902965476051019b20fd1621e (diff)
downloadllvm-dbd2fed6a1a1ae2efb64255fdd0e07a04a2d1f13.zip
llvm-dbd2fed6a1a1ae2efb64255fdd0e07a04a2d1f13.tar.gz
llvm-dbd2fed6a1a1ae2efb64255fdd0e07a04a2d1f13.tar.bz2
Apply summary-based dead stripping to regular LTO modules with summaries.
If a regular LTO module has a summary index, then instead of linking it into the combined regular LTO module right away, add it to the combined summary index and associate it with a special module that represents the combined regular LTO module. Any such modules are linked during LTO::run(), at which time we use the results of summary-based dead stripping to control whether to link prevailing symbols. Differential Revision: https://reviews.llvm.org/D33922 llvm-svn: 305482
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 9c4316f..bd01902 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -964,11 +964,11 @@ Expected<BitcodeModule> clang::FindThinLTOModule(MemoryBufferRef MBRef) {
if (!BMsOrErr)
return BMsOrErr.takeError();
- // The bitcode file may contain multiple modules, we want the one with a
- // summary.
+ // The bitcode file may contain multiple modules, we want the one that is
+ // marked as being the ThinLTO module.
for (BitcodeModule &BM : *BMsOrErr) {
- Expected<bool> HasSummary = BM.hasSummary();
- if (HasSummary && *HasSummary)
+ Expected<BitcodeLTOInfo> LTOInfo = BM.getLTOInfo();
+ if (LTOInfo && LTOInfo->IsThinLTO)
return BM;
}