Use isWeakForLinker() hook
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53318 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp
index 483af12..0c74d5a 100644
--- a/lib/Target/TargetAsmInfo.cpp
+++ b/lib/Target/TargetAsmInfo.cpp
@@ -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)