add support for hidden visibility to darwin/ppc and linux/ppc targets
llvm-svn: 33200
diff --git a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 194a499..7db96a7 100644
--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -550,6 +550,11 @@
O << "\t.weak\t" << CurrentFnName << '\n';
break;
}
+
+ if (F->hasHiddenVisibility())
+ if (const char *Directive = TAI->getHiddenDirective())
+ O << Directive << CurrentFnName << "\n";
+
EmitAlignment(2, F);
O << CurrentFnName << ":\n";
@@ -608,8 +613,13 @@
// Check to see if this is a special global used by LLVM, if so, emit it.
if (EmitSpecialLLVMGlobal(I))
continue;
-
+
std::string name = Mang->getValueName(I);
+
+ if (I->hasHiddenVisibility())
+ if (const char *Directive = TAI->getHiddenDirective())
+ O << Directive << name << "\n";
+
Constant *C = I->getInitializer();
unsigned Size = TD->getTypeSize(C->getType());
unsigned Align = TD->getPreferredAlignmentLog(I);
@@ -749,6 +759,11 @@
O << "\t.weak_definition\t" << CurrentFnName << "\n";
break;
}
+
+ if (F->hasHiddenVisibility())
+ if (const char *Directive = TAI->getHiddenDirective())
+ O << Directive << CurrentFnName << "\n";
+
EmitAlignment(4, F);
O << CurrentFnName << ":\n";
@@ -840,6 +855,11 @@
continue;
std::string name = Mang->getValueName(I);
+
+ if (I->hasHiddenVisibility())
+ if (const char *Directive = TAI->getHiddenDirective())
+ O << Directive << name << "\n";
+
Constant *C = I->getInitializer();
unsigned Size = TD->getTypeSize(C->getType());
unsigned Align = TD->getPreferredAlignmentLog(I);