[llvm-commits] [llvm] r53318 - in /llvm/trunk/lib/Target: TargetAsmInfo.cpp X86/X86ATTAsmPrinter.cpp X86/X86TargetAsmInfo.cpp
Anton Korobeynikov
asl at math.spbu.ru
Wed Jul 9 06:27:59 PDT 2008
Author: asl
Date: Wed Jul 9 08:27:59 2008
New Revision: 53318
URL: http://llvm.org/viewvc/llvm-project?rev=53318&view=rev
Log:
Use isWeakForLinker() hook
Modified:
llvm/trunk/lib/Target/TargetAsmInfo.cpp
llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp
llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetAsmInfo.cpp?rev=53318&r1=53317&r2=53318&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Wed Jul 9 08:27:59 2008
@@ -228,9 +228,7 @@
assert(0 && "Unexpected section kind!");
}
- if (GV->hasLinkOnceLinkage() ||
- GV->hasWeakLinkage() ||
- GV->hasCommonLinkage())
+ if (GV->isWeakForLinker())
Flags |= SectionFlags::Linkonce;
}
@@ -289,9 +287,7 @@
TargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
SectionKind::Kind Kind = SectionKindForGlobal(GV);
- if (GV->hasLinkOnceLinkage() ||
- GV->hasWeakLinkage() ||
- GV->hasCommonLinkage())
+ if (GV->isWeakForLinker())
return UniqueSectionForGlobal(GV, Kind);
else {
if (Kind == SectionKind::Text)
Modified: llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp?rev=53318&r1=53317&r2=53318&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp Wed Jul 9 08:27:59 2008
@@ -399,10 +399,7 @@
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 @@
}
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) {
Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=53318&r1=53317&r2=53318&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Wed Jul 9 08:27:59 2008
@@ -224,9 +224,7 @@
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 @@
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) {
More information about the llvm-commits
mailing list