Enable protected visibility on ARM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36583 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Lauro Ramos Venancio 2007-04-30 00:23:51 +00:00
parent 126b1b8683
commit 0a1817392d
2 changed files with 16 additions and 4 deletions

View File

@ -210,9 +210,14 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
break;
}
const char *VisibilityDirective = NULL;
if (F->hasHiddenVisibility())
if (const char *Directive = TAI->getHiddenDirective())
O << Directive << CurrentFnName << "\n";
VisibilityDirective = TAI->getHiddenDirective();
else if (F->hasProtectedVisibility())
VisibilityDirective = TAI->getProtectedDirective();
if (VisibilityDirective)
O << VisibilityDirective << CurrentFnName << "\n";
if (AFI->isThumbFunction()) {
EmitAlignment(AFI->getAlign(), F);
@ -791,9 +796,15 @@ bool ARMAsmPrinter::doFinalization(Module &M) {
unsigned Size = TD->getTypeSize(Type);
unsigned Align = TD->getPreferredAlignmentLog(I);
const char *VisibilityDirective = NULL;
if (I->hasHiddenVisibility())
if (const char *Directive = TAI->getHiddenDirective())
O << Directive << name << "\n";
VisibilityDirective = TAI->getHiddenDirective();
else if (I->hasProtectedVisibility())
VisibilityDirective = TAI->getProtectedDirective();
if (VisibilityDirective)
O << VisibilityDirective << name << "\n";
if (Subtarget->isTargetELF())
O << "\t.type " << name << ",%object\n";

View File

@ -27,6 +27,7 @@ ARMTargetAsmInfo::ARMTargetAsmInfo(const ARMTargetMachine &TM) {
SetDirective = "\t.set";
WeakRefDirective = "\t.weak_reference\t";
HiddenDirective = "\t.private_extern\t";
ProtectedDirective = NULL;
JumpTableDataSection = ".const";
CStringSection = "\t.cstring";
FourByteConstantSection = "\t.literal4\n";