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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76659 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 3d2203d6bb2e0abf801885ae508b4894d7e41bde..6c613ef166579089b520fe237a1fc7aca6ee27dc 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 a1e11fe78685f4604f6496796edfd36646a540e3..3582effa901cee0a985e317b9ebee1f359c248ef 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;