diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-01-14 06:37:54 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-01-14 06:37:54 +0000 |
| commit | 70d4107a45ab39e1bc3e7a67a86b59655cba34ec (patch) | |
| tree | b68bf5953fe8f7579a395b467d468fe5a2dbcb12 /lib/Target/PowerPC/PPCAsmPrinter.cpp | |
| parent | 4580e529f9f7038f91735b20bbbca384902574b9 (diff) | |
add support for hidden visibility to darwin/ppc and linux/ppc targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33200 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCAsmPrinter.cpp')
| -rw-r--r-- | lib/Target/PowerPC/PPCAsmPrinter.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index 194a499b8b..7db96a7f78 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -550,6 +550,11 @@ bool LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) { 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 @@ bool LinuxAsmPrinter::doFinalization(Module &M) { // 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 @@ bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) { 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 @@ bool DarwinAsmPrinter::doFinalization(Module &M) { 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); |
