Remove the XCore custom implementation of MergeableConstSection, relying on
authorChris Lattner <sabre@nondot.org>
Tue, 21 Jul 2009 22:25:52 +0000 (22:25 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 21 Jul 2009 22:25:52 +0000 (22:25 +0000)
the generic ELF version instead.  This will result in its mergable constant
sections getting named ".rodata.cst4" instead of ".cp.const4", but the
linker looks at the section flags, not the name of the section AFAICT.

llvm-svn: 76659

llvm/lib/Target/XCore/XCoreTargetAsmInfo.cpp
llvm/lib/Target/XCore/XCoreTargetAsmInfo.h

index 3d2203d..6c613ef 100644 (file)
@@ -89,23 +89,6 @@ XCoreTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
   return ELFTargetAsmInfo::SelectSectionForGlobal(GV);
 }
 
-const Section*
-XCoreTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
-  const TargetData *TD = TM.getTargetData();
-
-  unsigned Size = TD->getTypeAllocSize(Ty);
-  if (Size == 4 || Size == 8 || Size == 16) {
-    std::string Name =  ".cp.const" + utostr(Size);
-
-    return getNamedSection(Name.c_str(),
-                           SectionFlags::setEntitySize(SectionFlags::Mergeable |
-                                                       SectionFlags::Small,
-                                                       Size));
-  }
-
-  return getReadOnlySection();
-}
-
 unsigned XCoreTargetAsmInfo::
 SectionFlagsForGlobal(const GlobalValue *GV, const char* Name) const {
   unsigned Flags = ELFTargetAsmInfo::SectionFlagsForGlobal(GV, Name);
index a1e11fe..3582eff 100644 (file)
@@ -29,7 +29,6 @@ namespace llvm {
     explicit XCoreTargetAsmInfo(const XCoreTargetMachine &TM);
     
     virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
-    const Section* MergeableConstSection(const Type *Ty) const;
     virtual unsigned
     SectionFlagsForGlobal(const GlobalValue *GV = NULL,
                           const char* name = NULL) const;