summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2017-02-02 18:13:46 +0000
committerMehdi Amini <mehdi.amini@apple.com>2017-02-02 18:13:46 +0000
commitdc5a7444f0e32012b8c612bfb6fdb3ebc65addac (patch)
tree2f4ba15943be096bb3f5f7ed66949f0d41d00f3d /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent8d17b4050076c9dea7b68dc0ac208de8f19d9c01 (diff)
downloadbcm5719-llvm-dc5a7444f0e32012b8c612bfb6fdb3ebc65addac.tar.gz
bcm5719-llvm-dc5a7444f0e32012b8c612bfb6fdb3ebc65addac.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. Differential Revision: https://reviews.llvm.org/D28978 llvm-svn: 293912
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 4eac89c37a5..bdb57f59dde 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -971,13 +971,13 @@ static unsigned getEncodedLinkage(const GlobalValue &GV) {
static uint64_t getEncodedGVSummaryFlags(GlobalValueSummary::GVFlags Flags) {
uint64_t RawFlags = 0;
- RawFlags |= Flags.NotEligibleToImport; // bool
- RawFlags |= (Flags.LiveRoot << 1);
// Linkage don't need to be remapped at that time for the summary. Any future
// change to the getEncodedLinkage() function will need to be taken into
// account here as well.
- RawFlags = (RawFlags << 4) | Flags.Linkage; // 4 bits
-
+ RawFlags |= Flags.Linkage; // 4 bits linkage
+ RawFlags |= (Flags.NotEligibleToImport << 4); // bool
+ RawFlags |= (Flags.LiveRoot << 5); // bool
+ RawFlags |= (Flags.AutoHide << 6); // bool
return RawFlags;
}
OpenPOWER on IntegriCloud