mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 23:32:27 +00:00
Omit private_extern declarations of extern symbols; followup to
r124468. Patch by Rafael Avila de Espindola! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126297 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e573fb3255
commit
5129bdecd8
@ -445,7 +445,8 @@ namespace llvm {
|
||||
|
||||
/// EmitVisibility - This emits visibility information about symbol, if
|
||||
/// this is suported by the target.
|
||||
void EmitVisibility(MCSymbol *Sym, unsigned Visibility) const;
|
||||
void EmitVisibility(MCSymbol *Sym, unsigned Visibility,
|
||||
bool IsDefinition = true) const;
|
||||
|
||||
void EmitLinkage(unsigned Linkage, MCSymbol *GVSym) const;
|
||||
|
||||
|
@ -246,6 +246,11 @@ namespace llvm {
|
||||
/// declare a symbol as having hidden visibility.
|
||||
MCSymbolAttr HiddenVisibilityAttr; // Defaults to MCSA_Hidden.
|
||||
|
||||
/// HiddenDeclarationVisibilityAttr - This attribute, if not MCSA_Invalid,
|
||||
/// is used to declare an undefined symbol as having hidden visibility.
|
||||
MCSymbolAttr HiddenDeclarationVisibilityAttr; // Defaults to MCSA_Hidden.
|
||||
|
||||
|
||||
/// ProtectedVisibilityAttr - This attribute, if not MCSA_Invalid, is used
|
||||
/// to declare a symbol as having protected visibility.
|
||||
MCSymbolAttr ProtectedVisibilityAttr; // Defaults to MCSA_Protected
|
||||
@ -425,6 +430,9 @@ namespace llvm {
|
||||
const char *getLinkOnceDirective() const { return LinkOnceDirective; }
|
||||
|
||||
MCSymbolAttr getHiddenVisibilityAttr() const { return HiddenVisibilityAttr;}
|
||||
MCSymbolAttr getHiddenDeclarationVisibilityAttr() const {
|
||||
return HiddenDeclarationVisibilityAttr;
|
||||
}
|
||||
MCSymbolAttr getProtectedVisibilityAttr() const {
|
||||
return ProtectedVisibilityAttr;
|
||||
}
|
||||
|
@ -764,7 +764,7 @@ bool AsmPrinter::doFinalization(Module &M) {
|
||||
continue;
|
||||
|
||||
MCSymbol *Name = Mang->getSymbol(&F);
|
||||
EmitVisibility(Name, V);
|
||||
EmitVisibility(Name, V, false);
|
||||
}
|
||||
|
||||
// Finalize debug and EH information.
|
||||
@ -1820,13 +1820,17 @@ void AsmPrinter::EmitBasicBlockStart(const MachineBasicBlock *MBB) const {
|
||||
}
|
||||
}
|
||||
|
||||
void AsmPrinter::EmitVisibility(MCSymbol *Sym, unsigned Visibility) const {
|
||||
void AsmPrinter::EmitVisibility(MCSymbol *Sym, unsigned Visibility,
|
||||
bool IsDefinition) const {
|
||||
MCSymbolAttr Attr = MCSA_Invalid;
|
||||
|
||||
switch (Visibility) {
|
||||
default: break;
|
||||
case GlobalValue::HiddenVisibility:
|
||||
Attr = MAI->getHiddenVisibilityAttr();
|
||||
if (IsDefinition)
|
||||
Attr = MAI->getHiddenVisibilityAttr();
|
||||
else
|
||||
Attr = MAI->getHiddenDeclarationVisibilityAttr();
|
||||
break;
|
||||
case GlobalValue::ProtectedVisibility:
|
||||
Attr = MAI->getProtectedVisibilityAttr();
|
||||
|
@ -65,6 +65,7 @@ MCAsmInfo::MCAsmInfo() {
|
||||
WeakDefDirective = 0;
|
||||
LinkOnceDirective = 0;
|
||||
HiddenVisibilityAttr = MCSA_Hidden;
|
||||
HiddenDeclarationVisibilityAttr = MCSA_Hidden;
|
||||
ProtectedVisibilityAttr = MCSA_Protected;
|
||||
HasLEB128 = false;
|
||||
SupportsDebugInformation = false;
|
||||
|
@ -45,6 +45,7 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() {
|
||||
HasAggressiveSymbolFolding = false;
|
||||
|
||||
HiddenVisibilityAttr = MCSA_PrivateExtern;
|
||||
HiddenDeclarationVisibilityAttr = MCSA_Invalid;
|
||||
// Doesn't support protected visibility.
|
||||
ProtectedVisibilityAttr = MCSA_Global;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user