make some stuff private.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76661 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/llvm/Target/DarwinTargetAsmInfo.h b/include/llvm/Target/DarwinTargetAsmInfo.h
index 171a6b3..8eef95d 100644
--- a/include/llvm/Target/DarwinTargetAsmInfo.h
+++ b/include/llvm/Target/DarwinTargetAsmInfo.h
@@ -39,10 +39,11 @@
                                                SectionKind::Kind kind) const;
     virtual bool emitUsedDirectiveFor(const GlobalValue *GV,
                                       Mangler *Mang) const;
-    const Section* MergeableConstSection(const GlobalVariable *GV) const;
+    const Section* SelectSectionForMachineConst(const Type *Ty) const;
+    
+  private:
     const Section* MergeableConstSection(const Type *Ty) const;
     const Section* MergeableStringSection(const GlobalVariable *GV) const;
-    const Section* SelectSectionForMachineConst(const Type *Ty) const;
   };
 }
 
diff --git a/include/llvm/Target/ELFTargetAsmInfo.h b/include/llvm/Target/ELFTargetAsmInfo.h
index ecde4ee..fd269a1 100644
--- a/include/llvm/Target/ELFTargetAsmInfo.h
+++ b/include/llvm/Target/ELFTargetAsmInfo.h
@@ -28,8 +28,6 @@
     SectionKind::Kind SectionKindForGlobal(const GlobalValue *GV) const;
     virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
     virtual std::string printSectionFlags(unsigned flags) const;
-    const Section* MergeableConstSection(const Type *Ty) const;
-    const Section* MergeableStringSection(const GlobalVariable *GV) const;
     virtual const Section*
     SelectSectionForMachineConst(const Type *Ty) const;
 
@@ -37,6 +35,10 @@
     const Section* DataRelLocalSection;
     const Section* DataRelROSection;
     const Section* DataRelROLocalSection;
+    
+  private:
+    const Section* MergeableConstSection(const Type *Ty) const;
+    const Section* MergeableStringSection(const GlobalVariable *GV) const;
   };
 }
 
diff --git a/lib/Target/DarwinTargetAsmInfo.cpp b/lib/Target/DarwinTargetAsmInfo.cpp
index 31c29a7..ec300b9 100644
--- a/lib/Target/DarwinTargetAsmInfo.cpp
+++ b/lib/Target/DarwinTargetAsmInfo.cpp
@@ -156,9 +156,9 @@
             ConstTextCoalSection :
             MergeableStringSection(cast<GlobalVariable>(GV)));
    case SectionKind::RODataMergeConst:
-    return (isWeak ?
-            ConstDataCoalSection:
-            MergeableConstSection(cast<GlobalVariable>(GV)));
+    if (isWeak) return ConstDataCoalSection;
+    return MergeableConstSection(cast<GlobalVariable>(GV)
+                                 ->getInitializer()->getType());
    default:
     llvm_unreachable("Unsuported section kind for global");
   }
@@ -184,13 +184,6 @@
 }
 
 const Section*
-DarwinTargetAsmInfo::MergeableConstSection(const GlobalVariable *GV) const {
-  Constant *C = GV->getInitializer();
-
-  return MergeableConstSection(C->getType());
-}
-
-inline const Section*
 DarwinTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
   const TargetData *TD = TM.getTargetData();