[llvm-branch-commits] [llvm-branch] r126416 - in /llvm/branches/Apple/palisade: include/llvm/CodeGen/AsmPrinter.h include/llvm/MC/MCAsmInfo.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/MC/MCAsmInfo.cpp lib/MC/MCAsmInfoDarwin.cpp
Daniel Dunbar
daniel at zuster.org
Thu Feb 24 12:02:27 PST 2011
Author: ddunbar
Date: Thu Feb 24 14:02:27 2011
New Revision: 126416
URL: http://llvm.org/viewvc/llvm-project?rev=126416&view=rev
Log:
Merge r126297:
--
Author: Stuart Hastings <stuart at apple.com>
Date: Wed Feb 23 02:27:05 2011 +0000
Omit private_extern declarations of extern symbols; followup to
r124468. Patch by Rafael Avila de Espindola!
Modified:
llvm/branches/Apple/palisade/include/llvm/CodeGen/AsmPrinter.h
llvm/branches/Apple/palisade/include/llvm/MC/MCAsmInfo.h
llvm/branches/Apple/palisade/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/branches/Apple/palisade/lib/MC/MCAsmInfo.cpp
llvm/branches/Apple/palisade/lib/MC/MCAsmInfoDarwin.cpp
Modified: llvm/branches/Apple/palisade/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/palisade/include/llvm/CodeGen/AsmPrinter.h?rev=126416&r1=126415&r2=126416&view=diff
==============================================================================
--- llvm/branches/Apple/palisade/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/branches/Apple/palisade/include/llvm/CodeGen/AsmPrinter.h Thu Feb 24 14:02:27 2011
@@ -445,7 +445,8 @@
/// 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;
Modified: llvm/branches/Apple/palisade/include/llvm/MC/MCAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/palisade/include/llvm/MC/MCAsmInfo.h?rev=126416&r1=126415&r2=126416&view=diff
==============================================================================
--- llvm/branches/Apple/palisade/include/llvm/MC/MCAsmInfo.h (original)
+++ llvm/branches/Apple/palisade/include/llvm/MC/MCAsmInfo.h Thu Feb 24 14:02:27 2011
@@ -246,6 +246,11 @@
/// 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 @@
const char *getLinkOnceDirective() const { return LinkOnceDirective; }
MCSymbolAttr getHiddenVisibilityAttr() const { return HiddenVisibilityAttr;}
+ MCSymbolAttr getHiddenDeclarationVisibilityAttr() const {
+ return HiddenDeclarationVisibilityAttr;
+ }
MCSymbolAttr getProtectedVisibilityAttr() const {
return ProtectedVisibilityAttr;
}
Modified: llvm/branches/Apple/palisade/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/palisade/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=126416&r1=126415&r2=126416&view=diff
==============================================================================
--- llvm/branches/Apple/palisade/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/branches/Apple/palisade/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu Feb 24 14:02:27 2011
@@ -764,7 +764,7 @@
continue;
MCSymbol *Name = Mang->getSymbol(&F);
- EmitVisibility(Name, V);
+ EmitVisibility(Name, V, false);
}
// Finalize debug and EH information.
@@ -1820,13 +1820,17 @@
}
}
-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();
Modified: llvm/branches/Apple/palisade/lib/MC/MCAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/palisade/lib/MC/MCAsmInfo.cpp?rev=126416&r1=126415&r2=126416&view=diff
==============================================================================
--- llvm/branches/Apple/palisade/lib/MC/MCAsmInfo.cpp (original)
+++ llvm/branches/Apple/palisade/lib/MC/MCAsmInfo.cpp Thu Feb 24 14:02:27 2011
@@ -65,6 +65,7 @@
WeakDefDirective = 0;
LinkOnceDirective = 0;
HiddenVisibilityAttr = MCSA_Hidden;
+ HiddenDeclarationVisibilityAttr = MCSA_Hidden;
ProtectedVisibilityAttr = MCSA_Protected;
HasLEB128 = false;
SupportsDebugInformation = false;
Modified: llvm/branches/Apple/palisade/lib/MC/MCAsmInfoDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/palisade/lib/MC/MCAsmInfoDarwin.cpp?rev=126416&r1=126415&r2=126416&view=diff
==============================================================================
--- llvm/branches/Apple/palisade/lib/MC/MCAsmInfoDarwin.cpp (original)
+++ llvm/branches/Apple/palisade/lib/MC/MCAsmInfoDarwin.cpp Thu Feb 24 14:02:27 2011
@@ -45,6 +45,7 @@
HasAggressiveSymbolFolding = false;
HiddenVisibilityAttr = MCSA_PrivateExtern;
+ HiddenDeclarationVisibilityAttr = MCSA_Invalid;
// Doesn't support protected visibility.
ProtectedVisibilityAttr = MCSA_Global;
More information about the llvm-branch-commits
mailing list