summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO/LTOModule.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 /llvm/lib/LTO/LTOModule.cpp
parent587525468d4fc61902965476051019b20fd1621e (diff)
downloadbcm5719-llvm-dbd2fed6a1a1ae2efb64255fdd0e07a04a2d1f13.tar.gz
bcm5719-llvm-dbd2fed6a1a1ae2efb64255fdd0e07a04a2d1f13.zip
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 'llvm/lib/LTO/LTOModule.cpp')
-rw-r--r--llvm/lib/LTO/LTOModule.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/LTO/LTOModule.cpp b/llvm/lib/LTO/LTOModule.cpp
index 331c51af56b..3cc8b7d0e77 100644
--- a/llvm/lib/LTO/LTOModule.cpp
+++ b/llvm/lib/LTO/LTOModule.cpp
@@ -77,14 +77,12 @@ bool LTOModule::isBitcodeFile(StringRef Path) {
}
bool LTOModule::isThinLTO() {
- // Right now the detection is only based on the summary presence. We may want
- // to add a dedicated flag at some point.
- Expected<bool> Result = hasGlobalValueSummary(MBRef);
+ Expected<BitcodeLTOInfo> Result = getBitcodeLTOInfo(MBRef);
if (!Result) {
logAllUnhandledErrors(Result.takeError(), errs(), "");
return false;
}
- return *Result;
+ return Result->IsThinLTO;
}
bool LTOModule::isBitcodeForTarget(MemoryBuffer *Buffer,
OpenPOWER on IntegriCloud