diff options
author | Chris Lattner <sabre@nondot.org> | 2003-10-16 18:29:00 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-10-16 18:29:00 +0000 |
commit | 72ac148d4964fbff950fe11a0eeeda73973b849b (patch) | |
tree | fde7ca11baf974328570db3b0d678d98e576fb30 /lib/Target/X86 | |
parent | 6b25242a4ba80e8c3a8a2664eefeba9c69814012 (diff) | |
download | external_llvm-72ac148d4964fbff950fe11a0eeeda73973b849b.zip external_llvm-72ac148d4964fbff950fe11a0eeeda73973b849b.tar.gz external_llvm-72ac148d4964fbff950fe11a0eeeda73973b849b.tar.bz2 |
Add support for 'weak' linkage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9171 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86')
-rw-r--r-- | lib/Target/X86/Printer.cpp | 4 | ||||
-rw-r--r-- | lib/Target/X86/X86AsmPrinter.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/Target/X86/Printer.cpp b/lib/Target/X86/Printer.cpp index fbc6b6e..f8c006c 100644 --- a/lib/Target/X86/Printer.cpp +++ b/lib/Target/X86/Printer.cpp @@ -948,7 +948,8 @@ bool Printer::doFinalization(Module &M) { unsigned Align = TD.getTypeAlignment(C->getType()); if (C->isNullValue() && - (I->hasLinkOnceLinkage() || I->hasInternalLinkage())) { + (I->hasLinkOnceLinkage() || I->hasInternalLinkage() || + I->hasWeakLinkage() /* FIXME: Verify correct */)) { SwitchSection(O, CurSection, ".data"); if (I->hasInternalLinkage()) O << "\t.local " << name << "\n"; @@ -961,6 +962,7 @@ bool Printer::doFinalization(Module &M) { } else { switch (I->getLinkage()) { case GlobalValue::LinkOnceLinkage: + case GlobalValue::WeakLinkage: // FIXME: Verify correct for weak. // Nonnull linkonce -> weak O << "\t.weak " << name << "\n"; SwitchSection(O, CurSection, ""); diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp index fbc6b6e..f8c006c 100644 --- a/lib/Target/X86/X86AsmPrinter.cpp +++ b/lib/Target/X86/X86AsmPrinter.cpp @@ -948,7 +948,8 @@ bool Printer::doFinalization(Module &M) { unsigned Align = TD.getTypeAlignment(C->getType()); if (C->isNullValue() && - (I->hasLinkOnceLinkage() || I->hasInternalLinkage())) { + (I->hasLinkOnceLinkage() || I->hasInternalLinkage() || + I->hasWeakLinkage() /* FIXME: Verify correct */)) { SwitchSection(O, CurSection, ".data"); if (I->hasInternalLinkage()) O << "\t.local " << name << "\n"; @@ -961,6 +962,7 @@ bool Printer::doFinalization(Module &M) { } else { switch (I->getLinkage()) { case GlobalValue::LinkOnceLinkage: + case GlobalValue::WeakLinkage: // FIXME: Verify correct for weak. // Nonnull linkonce -> weak O << "\t.weak " << name << "\n"; SwitchSection(O, CurSection, ""); |