diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2017-02-03 00:32:38 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2017-02-03 00:32:38 +0000 |
commit | b0a8ff71e543ad01bdb684866176a63e72a472f8 (patch) | |
tree | 0518ef60c2a529b2e728681c0bf99c613d7ac710 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | bbb2b95ce54e1bde4e2df42969876d22a7415daf (diff) | |
download | llvm-b0a8ff71e543ad01bdb684866176a63e72a472f8.zip llvm-b0a8ff71e543ad01bdb684866176a63e72a472f8.tar.gz llvm-b0a8ff71e543ad01bdb684866176a63e72a472f8.tar.bz2 |
[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,
and a recommit of r293918 after fixing LLD tests.
Differential Revision: https://reviews.llvm.org/D28978
llvm-svn: 293970
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 4eac89c..bdb57f5 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; } |