summaryrefslogtreecommitdiff
path: root/lib/Target
diff options
context:
space:
mode:
authorLauro Ramos Venancio <lauro.venancio@gmail.com>2007-04-30 00:23:51 +0000
committerLauro Ramos Venancio <lauro.venancio@gmail.com>2007-04-30 00:23:51 +0000
commit0a1817392d3ad7ec2681e6bf495f490c443ec0b7 (patch)
tree58d76b98f15347c54ca310de560c0dd5dd2847b9 /lib/Target
parent126b1b868309659e124f7706bc8161943cfc0290 (diff)
downloadllvm-0a1817392d3ad7ec2681e6bf495f490c443ec0b7.tar.gz
llvm-0a1817392d3ad7ec2681e6bf495f490c443ec0b7.tar.bz2
llvm-0a1817392d3ad7ec2681e6bf495f490c443ec0b7.tar.xz
Enable protected visibility on ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36583 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/ARM/ARMAsmPrinter.cpp19
-rw-r--r--lib/Target/ARM/ARMTargetAsmInfo.cpp1
2 files changed, 16 insertions, 4 deletions
diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp
index d873378986..6cda7ebe1f 100644
--- a/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/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";
diff --git a/lib/Target/ARM/ARMTargetAsmInfo.cpp b/lib/Target/ARM/ARMTargetAsmInfo.cpp
index 3d24d60c6a..b4b4da1826 100644
--- a/lib/Target/ARM/ARMTargetAsmInfo.cpp
+++ b/lib/Target/ARM/ARMTargetAsmInfo.cpp
@@ -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";