diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2009-01-15 20:18:42 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2009-01-15 20:18:42 +0000 |
commit | bb46f52027416598a662dc1c58f48d9d56b1a65b (patch) | |
tree | ebdd7fc62b19bc9bdb7cc03563fd817d3943f17e /lib/Target/X86/AsmPrinter | |
parent | f193ff05909c2de373032f773e76804474b1ef4e (diff) | |
download | external_llvm-bb46f52027416598a662dc1c58f48d9d56b1a65b.zip external_llvm-bb46f52027416598a662dc1c58f48d9d56b1a65b.tar.gz external_llvm-bb46f52027416598a662dc1c58f48d9d56b1a65b.tar.bz2 |
Add the private linkage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62279 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/AsmPrinter')
-rw-r--r-- | lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | 12 | ||||
-rw-r--r-- | lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp | 1 |
2 files changed, 8 insertions, 5 deletions
diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp index 5378967..df0b107 100644 --- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp @@ -159,6 +159,7 @@ void X86ATTAsmPrinter::emitFunctionHeader(const MachineFunction &MF) { switch (F->getLinkage()) { default: assert(0 && "Unknown linkage type!"); case Function::InternalLinkage: // Symbols default to internal. + case Function::PrivateLinkage: EmitAlignment(FnAlign, F); break; case Function::DLLExportLinkage: @@ -188,7 +189,7 @@ void X86ATTAsmPrinter::emitFunctionHeader(const MachineFunction &MF) { else if (Subtarget->isTargetCygMing()) { O << "\t.def\t " << CurrentFnName << ";\t.scl\t" << - (F->getLinkage() == Function::InternalLinkage ? COFF::C_STAT : COFF::C_EXT) + (F->hasInternalLinkage() ? COFF::C_STAT : COFF::C_EXT) << ";\t.type\t" << (COFF::DT_FCN << COFF::N_BTSHFT) << ";\t.endef\n"; } @@ -421,7 +422,7 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo, if (shouldPrintPLT(TM, Subtarget)) { // Assemble call via PLT for externally visible symbols if (!GV->hasHiddenVisibility() && !GV->hasProtectedVisibility() && - !GV->hasInternalLinkage()) + !GV->hasLocalLinkage()) O << "@PLT"; } if (Subtarget->isTargetCygMing() && GV->isDeclaration()) @@ -789,11 +790,11 @@ void X86ATTAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) { } if (!GVar->isThreadLocal() && - (GVar->hasInternalLinkage() || GVar->mayBeOverridden())) { + (GVar->hasLocalLinkage() || GVar->mayBeOverridden())) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. if (TAI->getLCOMMDirective() != NULL) { - if (GVar->hasInternalLinkage()) { + if (GVar->hasLocalLinkage()) { O << TAI->getLCOMMDirective() << name << ',' << Size; if (Subtarget->isTargetDarwin()) O << ',' << Align; @@ -813,7 +814,7 @@ void X86ATTAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) { } } else { if (!Subtarget->isTargetCygMing()) { - if (GVar->hasInternalLinkage()) + if (GVar->hasLocalLinkage()) O << "\t.local\t" << name << '\n'; } O << TAI->getCOMMDirective() << name << ',' << Size; @@ -849,6 +850,7 @@ void X86ATTAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) { // If external or appending, declare as a global symbol O << "\t.globl " << name << '\n'; // FALL THROUGH + case GlobalValue::PrivateLinkage: case GlobalValue::InternalLinkage: break; default: diff --git a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp index 58bd8de..a75422a 100644 --- a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp @@ -145,6 +145,7 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) { FnAlign = 1; switch (F->getLinkage()) { default: assert(0 && "Unsupported linkage type!"); + case Function::PrivateLinkage: case Function::InternalLinkage: EmitAlignment(FnAlign); break; |