[llvm-commits] [llvm] r76661 - in /llvm/trunk: include/llvm/Target/DarwinTargetAsmInfo.h include/llvm/Target/ELFTargetAsmInfo.h lib/Target/DarwinTargetAsmInfo.cpp

Chris Lattner sabre at nondot.org
Tue Jul 21 15:30:40 PDT 2009


Author: lattner
Date: Tue Jul 21 17:30:39 2009
New Revision: 76661

URL: http://llvm.org/viewvc/llvm-project?rev=76661&view=rev
Log:
make some stuff private.

Modified:
    llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h
    llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h
    llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp

Modified: llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h?rev=76661&r1=76660&r2=76661&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h Tue Jul 21 17:30:39 2009
@@ -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;
   };
 }
 

Modified: llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h?rev=76661&r1=76660&r2=76661&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h Tue Jul 21 17:30:39 2009
@@ -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;
   };
 }
 

Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp?rev=76661&r1=76660&r2=76661&view=diff

==============================================================================
--- llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Tue Jul 21 17:30:39 2009
@@ -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();
 





More information about the llvm-commits mailing list