mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-19 00:14:20 +00:00
Add a new scope type "LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN" for the
"linker_private_weak_auto_def" linkage type for LTO. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114868 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3b9569e70d
commit
7afea0cfc4
@ -20,25 +20,26 @@
|
||||
#include <stddef.h>
|
||||
#include "llvm/System/DataTypes.h"
|
||||
|
||||
#define LTO_API_VERSION 3
|
||||
#define LTO_API_VERSION 4
|
||||
|
||||
typedef enum {
|
||||
LTO_SYMBOL_ALIGNMENT_MASK = 0x0000001F, /* log2 of alignment */
|
||||
LTO_SYMBOL_PERMISSIONS_MASK = 0x000000E0,
|
||||
LTO_SYMBOL_PERMISSIONS_CODE = 0x000000A0,
|
||||
LTO_SYMBOL_PERMISSIONS_DATA = 0x000000C0,
|
||||
LTO_SYMBOL_PERMISSIONS_RODATA = 0x00000080,
|
||||
LTO_SYMBOL_DEFINITION_MASK = 0x00000700,
|
||||
LTO_SYMBOL_DEFINITION_REGULAR = 0x00000100,
|
||||
LTO_SYMBOL_DEFINITION_TENTATIVE = 0x00000200,
|
||||
LTO_SYMBOL_DEFINITION_WEAK = 0x00000300,
|
||||
LTO_SYMBOL_DEFINITION_UNDEFINED = 0x00000400,
|
||||
LTO_SYMBOL_DEFINITION_WEAKUNDEF = 0x00000500,
|
||||
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_ALIGNMENT_MASK = 0x0000001F, /* log2 of alignment */
|
||||
LTO_SYMBOL_PERMISSIONS_MASK = 0x000000E0,
|
||||
LTO_SYMBOL_PERMISSIONS_CODE = 0x000000A0,
|
||||
LTO_SYMBOL_PERMISSIONS_DATA = 0x000000C0,
|
||||
LTO_SYMBOL_PERMISSIONS_RODATA = 0x00000080,
|
||||
LTO_SYMBOL_DEFINITION_MASK = 0x00000700,
|
||||
LTO_SYMBOL_DEFINITION_REGULAR = 0x00000100,
|
||||
LTO_SYMBOL_DEFINITION_TENTATIVE = 0x00000200,
|
||||
LTO_SYMBOL_DEFINITION_WEAK = 0x00000300,
|
||||
LTO_SYMBOL_DEFINITION_UNDEFINED = 0x00000400,
|
||||
LTO_SYMBOL_DEFINITION_WEAKUNDEF = 0x00000500,
|
||||
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_SCOPE_DEFAULT_CAN_BE_HIDDEN = 0x00002800
|
||||
} lto_symbol_attributes;
|
||||
|
||||
typedef enum {
|
||||
|
@ -327,24 +327,24 @@ void LTOModule::addDefinedSymbol(GlobalValue *def, Mangler &mangler,
|
||||
// set definition part
|
||||
if (def->hasWeakLinkage() || def->hasLinkOnceLinkage() ||
|
||||
def->hasLinkerPrivateWeakLinkage() ||
|
||||
def->hasLinkerPrivateWeakDefAutoLinkage()) {
|
||||
def->hasLinkerPrivateWeakDefAutoLinkage())
|
||||
attr |= LTO_SYMBOL_DEFINITION_WEAK;
|
||||
}
|
||||
else if (def->hasCommonLinkage()) {
|
||||
else if (def->hasCommonLinkage())
|
||||
attr |= LTO_SYMBOL_DEFINITION_TENTATIVE;
|
||||
}
|
||||
else {
|
||||
else
|
||||
attr |= LTO_SYMBOL_DEFINITION_REGULAR;
|
||||
}
|
||||
|
||||
// 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())
|
||||
else if (def->hasExternalLinkage() || def->hasWeakLinkage() ||
|
||||
def->hasLinkOnceLinkage() || def->hasCommonLinkage() ||
|
||||
def->hasLinkerPrivateWeakLinkage())
|
||||
attr |= LTO_SYMBOL_SCOPE_DEFAULT;
|
||||
else if (def->hasLinkerPrivateWeakDefAutoLinkage())
|
||||
attr |= LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN;
|
||||
else
|
||||
attr |= LTO_SYMBOL_SCOPE_INTERNAL;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user