Add protected visibility to libLTO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60257 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky 2008-11-29 22:49:59 +00:00
parent 0ec48ddef2
commit 4fd40e884c
2 changed files with 4 additions and 1 deletions

View File

@ -30,9 +30,10 @@ typedef enum {
LTO_SYMBOL_DEFINITION_TENTATIVE = 0x00000200,
LTO_SYMBOL_DEFINITION_WEAK = 0x00000300,
LTO_SYMBOL_DEFINITION_UNDEFINED = 0x00000400,
LTO_SYMBOL_SCOPE_MASK = 0x00001800,
LTO_SYMBOL_SCOPE_MASK = 0x00003800,
LTO_SYMBOL_SCOPE_INTERNAL = 0x00000800,
LTO_SYMBOL_SCOPE_HIDDEN = 0x00001000,
LTO_SYMBOL_SCOPE_PROTECTED = 0x00002000,
LTO_SYMBOL_SCOPE_DEFAULT = 0x00001800
} lto_symbol_attributes;

View File

@ -224,6 +224,8 @@ void LTOModule::addDefinedSymbol(GlobalValue* def, Mangler &mangler,
// set scope part
if ( def->hasHiddenVisibility() )
attr |= LTO_SYMBOL_SCOPE_HIDDEN;
else if ( def->hasProtectedVisibility() )
attr |= LTO_SYMBOL_SCOPE_PROTECTED;
else if ( def->hasExternalLinkage() || def->hasWeakLinkage()
|| def->hasLinkOnceLinkage() || def->hasCommonLinkage() )
attr |= LTO_SYMBOL_SCOPE_DEFAULT;