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/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp
index 0fdc0ee..dd1bdb8 100644
--- a/lib/Target/X86/X86TargetAsmInfo.cpp
+++ b/lib/Target/X86/X86TargetAsmInfo.cpp
@@ -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) {