diff options
| author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-07-09 13:27:59 +0000 |
|---|---|---|
| committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-07-09 13:27:59 +0000 |
| commit | 577c45dd74c35bfcab81c45504e5c82b5704dbe3 (patch) | |
| tree | 754578f8c3094fd6041768681bbf6f34503633bb /llvm/lib/Target/X86 | |
| parent | deaa37362a25e6001101cb3894c73c447f92a37f (diff) | |
| download | bcm5719-llvm-577c45dd74c35bfcab81c45504e5c82b5704dbe3.tar.gz bcm5719-llvm-577c45dd74c35bfcab81c45504e5c82b5704dbe3.zip | |
Use isWeakForLinker() hook
llvm-svn: 53318
Diffstat (limited to 'llvm/lib/Target/X86')
| -rw-r--r-- | llvm/lib/Target/X86/X86ATTAsmPrinter.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86TargetAsmInfo.cpp | 8 |
2 files changed, 4 insertions, 12 deletions
diff --git a/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp b/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp index 0394b6c6cd8..0236e492888 100644 --- a/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp +++ b/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp @@ -399,10 +399,7 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo, if (shouldPrintStub(TM, Subtarget)) { // Link-once, declaration, or Weakly-linked global variables need // non-lazily-resolved stubs - if (GV->isDeclaration() || - GV->hasWeakLinkage() || - GV->hasLinkOnceLinkage() || - GV->hasCommonLinkage()) { + if (GV->isDeclaration() || GV->isWeakForLinker()) { // Dynamically-resolved functions need a stub for the function. if (isCallOp && isa<Function>(GV)) { FnStubs.insert(Name); @@ -802,8 +799,7 @@ void X86ATTAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) { } if (!GVar->isThreadLocal() && - (GVar->hasInternalLinkage() || GVar->hasWeakLinkage() || - GVar->hasLinkOnceLinkage() || GVar->hasCommonLinkage())) { + (GVar->hasInternalLinkage() || GVar->isWeakForLinker())) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. if (TAI->getLCOMMDirective() != NULL) { diff --git a/llvm/lib/Target/X86/X86TargetAsmInfo.cpp b/llvm/lib/Target/X86/X86TargetAsmInfo.cpp index 0fdc0eefbae..dd1bdb884ad 100644 --- a/llvm/lib/Target/X86/X86TargetAsmInfo.cpp +++ b/llvm/lib/Target/X86/X86TargetAsmInfo.cpp @@ -224,9 +224,7 @@ X86DarwinTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason, std::string X86DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const { SectionKind::Kind Kind = SectionKindForGlobal(GV); - bool isWeak = GV->hasWeakLinkage() || - GV->hasCommonLinkage() || - GV->hasLinkOnceLinkage(); + bool isWeak = GV->isWeakForLinker(); switch (Kind) { case SectionKind::Text: @@ -435,9 +433,7 @@ X86ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const { return UniqueSectionForGlobal(F, kind); } } else if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV)) { - if (GVar->hasCommonLinkage() || - GVar->hasLinkOnceLinkage() || - GVar->hasWeakLinkage()) + if (GVar->isWeakForLinker() return UniqueSectionForGlobal(GVar, kind); else { switch (kind) { |

