summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2017-02-02 18:31:35 +0000
committerMehdi Amini <mehdi.amini@apple.com>2017-02-02 18:31:35 +0000
commit97624fb1ec15e6e064c403ecfc3259b116e048e5 (patch)
tree39e04ac2af4cdc91c15c9363959b17aa9b37f97a /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent3e64d066de3e11a34ac02a2fab9f648ff056d4e2 (diff)
downloadbcm5719-llvm-97624fb1ec15e6e064c403ecfc3259b116e048e5.tar.gz
bcm5719-llvm-97624fb1ec15e6e064c403ecfc3259b116e048e5.zip
[ThinLTO] Add an auto-hide feature
When a symbol is not exported outside of the DSO, it is can be hidden. Usually we try to internalize as much as possible, but it is not always possible, for instance a symbol can be referenced outside of the LTO unit, or there can be cross-module reference in ThinLTO. This is a recommit of r293912 after fixing build failures. Differential Revision: https://reviews.llvm.org/D28978 llvm-svn: 293918
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index a46e49ccde8..c9d2ad5c71b 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -800,13 +800,14 @@ static GlobalValueSummary::GVFlags getDecodedGVSummaryFlags(uint64_t RawFlags,
// like getDecodedLinkage() above. Any future change to the linkage enum and
// to getDecodedLinkage() will need to be taken into account here as above.
auto Linkage = GlobalValue::LinkageTypes(RawFlags & 0xF); // 4 bits
- RawFlags = RawFlags >> 4;
- bool NotEligibleToImport = (RawFlags & 0x1) || Version < 3;
+ bool NotEligibleToImport = ((RawFlags >> 4) & 0x1) || Version < 3;
// The LiveRoot flag wasn't introduced until version 3. For dead stripping
// to work correctly on earlier versions, we must conservatively treat all
// values as live.
- bool LiveRoot = (RawFlags & 0x2) || Version < 3;
- return GlobalValueSummary::GVFlags(Linkage, NotEligibleToImport, LiveRoot);
+ bool LiveRoot = ((RawFlags >> 5) & 0x1) || Version < 3;
+ bool AutoHide = (RawFlags >> 6) & 0x1;
+ return GlobalValueSummary::GVFlags(Linkage, NotEligibleToImport, LiveRoot,
+ AutoHide);
}
static GlobalValue::VisibilityTypes getDecodedVisibility(unsigned Val) {
OpenPOWER on IntegriCloud