diff options
Diffstat (limited to 'llvm/lib/Target/ARM/ARMAsmPrinter.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMAsmPrinter.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp index d8733789863..6cda7ebe1f6 100644 --- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp @@ -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"; |