[llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86AsmPrinter.cpp
Anton Korobeynikov
asl at math.spbu.ru
Sun Apr 29 11:35:48 PDT 2007
Changes in directory llvm/lib/Target/X86:
X86ATTAsmPrinter.cpp updated: 1.103 -> 1.104
X86AsmPrinter.cpp updated: 1.240 -> 1.241
---
Log message:
Implement protected visibility. This partly implements PR1363: http://llvm.org/PR1363 . Linker
should be taught to deal with protected symbols.
---
Diffs of the changes: (+13 -3)
X86ATTAsmPrinter.cpp | 9 +++++++--
X86AsmPrinter.cpp | 7 ++++++-
2 files changed, 13 insertions(+), 3 deletions(-)
Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.103 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.104
--- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.103 Thu Apr 26 16:07:05 2007
+++ llvm/lib/Target/X86/X86ATTAsmPrinter.cpp Sun Apr 29 13:35:00 2007
@@ -125,9 +125,13 @@
}
break;
}
- if (F->hasHiddenVisibility())
+ if (F->hasHiddenVisibility()) {
if (const char *Directive = TAI->getHiddenDirective())
O << Directive << CurrentFnName << "\n";
+ } else if (F->hasProtectedVisibility()) {
+ if (const char *Directive = TAI->getProtectedDirective())
+ O << Directive << CurrentFnName << "\n";
+ }
if (Subtarget->isTargetELF())
O << "\t.type " << CurrentFnName << ", at function\n";
@@ -322,7 +326,8 @@
if (isCallOp && isa<Function>(GV)) {
if (printGOT(TM, Subtarget)) {
// Assemble call via PLT for non-local symbols
- if (!GV->hasHiddenVisibility() || GV->isDeclaration())
+ if (!(GV->hasHiddenVisibility() || GV->hasProtectedVisibility()) ||
+ GV->isDeclaration())
O << "@PLT";
}
if (Subtarget->isTargetCygMing() && GV->isDeclaration())
Index: llvm/lib/Target/X86/X86AsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.240 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.241
--- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.240 Fri Apr 20 16:38:10 2007
+++ llvm/lib/Target/X86/X86AsmPrinter.cpp Sun Apr 29 13:35:00 2007
@@ -155,9 +155,14 @@
unsigned Size = TD->getTypeSize(Type);
unsigned Align = TD->getPreferredAlignmentLog(I);
- if (I->hasHiddenVisibility())
+ if (I->hasHiddenVisibility()) {
if (const char *Directive = TAI->getHiddenDirective())
O << Directive << name << "\n";
+ } else if (I->hasProtectedVisibility()) {
+ if (const char *Directive = TAI->getProtectedDirective())
+ O << Directive << name << "\n";
+ }
+
if (Subtarget->isTargetELF())
O << "\t.type " << name << ", at object\n";
More information about the llvm-commits
mailing list