Remove some overridden functions in XCoreTargetAsmInfo that are
authorChris Lattner <sabre@nondot.org>
Tue, 21 Jul 2009 21:26:32 +0000 (21:26 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 21 Jul 2009 21:26:32 +0000 (21:26 +0000)
implemented exactly the same way as its ELFTargetAsmInfo subclass
has them.

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

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

index 6181e59a0553dced43b27e47ea267492d6c68cea..79f167a12a1bfa2d6884a31ce5b7c320d76f2746 100644 (file)
@@ -29,7 +29,7 @@ namespace llvm {
     virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
     virtual std::string printSectionFlags(unsigned flags) const;
     const Section* MergeableConstSection(const GlobalVariable *GV) const;
-    inline const Section* MergeableConstSection(const Type *Ty) const;
+    const Section* MergeableConstSection(const Type *Ty) const;
     const Section* MergeableStringSection(const GlobalVariable *GV) const;
     virtual const Section*
     SelectSectionForMachineConst(const Type *Ty) const;
index 0338ba4285873e5100c640531c5fe5607977b0da..e528aebf9a3dd56816a44cb2a8477d0135ff73ea 100644 (file)
@@ -142,11 +142,10 @@ ELFTargetAsmInfo::SelectSectionForMachineConst(const Type *Ty) const {
 
 const Section*
 ELFTargetAsmInfo::MergeableConstSection(const GlobalVariable *GV) const {
-  Constant *C = GV->getInitializer();
-  return MergeableConstSection(C->getType());
+  return MergeableConstSection(GV->getInitializer()->getType());
 }
 
-inline const Section*
+const Section*
 ELFTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
   const TargetData *TD = TM.getTargetData();
 
index 59ad624052ad1c6d80d8d056c06f4ec04134442d..3d2203d6bb2e0abf801885ae508b4894d7e41bde 100644 (file)
@@ -72,12 +72,9 @@ const Section*
 XCoreTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
   SectionKind::Kind Kind = SectionKindForGlobal(GV);
 
-  if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV))
-  {
+  if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV)) {
     if (!GVar->isWeakForLinker()) {
       switch (Kind) {
-      case SectionKind::RODataMergeStr:
-        return MergeableStringSection(GVar);
       case SectionKind::RODataMergeConst:
         return getReadOnlySection();
       case SectionKind::ThreadData:
@@ -93,17 +90,6 @@ XCoreTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
 }
 
 const Section*
-XCoreTargetAsmInfo::SelectSectionForMachineConst(const Type *Ty) const {
-  return MergeableConstSection(Ty);
-}
-
-const Section*
-XCoreTargetAsmInfo::MergeableConstSection(const GlobalVariable *GV) const {
-  Constant *C = GV->getInitializer();
-  return MergeableConstSection(C->getType());
-}
-
-inline const Section*
 XCoreTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
   const TargetData *TD = TM.getTargetData();
 
@@ -120,15 +106,8 @@ XCoreTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
   return getReadOnlySection();
 }
 
-const Section* XCoreTargetAsmInfo::
-MergeableStringSection(const GlobalVariable *GV) const {
-  // FIXME insert in correct mergable section
-  return getReadOnlySection();
-}
-
 unsigned XCoreTargetAsmInfo::
-SectionFlagsForGlobal(const GlobalValue *GV,
-                                     const char* Name) const {
+SectionFlagsForGlobal(const GlobalValue *GV, const char* Name) const {
   unsigned Flags = ELFTargetAsmInfo::SectionFlagsForGlobal(GV, Name);
   // Mask out unsupported flags
   Flags &= ~(SectionFlags::Small | SectionFlags::TLS);
@@ -162,41 +141,3 @@ SectionFlagsForGlobal(const GlobalValue *GV,
 
   return Flags;
 }
-
-std::string XCoreTargetAsmInfo::
-printSectionFlags(unsigned flags) const {
-  std::string Flags = ",\"";
-
-  if (!(flags & SectionFlags::Debug))
-    Flags += 'a';
-  if (flags & SectionFlags::Code)
-    Flags += 'x';
-  if (flags & SectionFlags::Writeable)
-    Flags += 'w';
-  if (flags & SectionFlags::Mergeable)
-    Flags += 'M';
-  if (flags & SectionFlags::Strings)
-    Flags += 'S';
-  if (flags & SectionFlags::TLS)
-    Flags += 'T';
-  if (flags & SectionFlags::Small) {
-    if (flags & SectionFlags::Writeable)
-      Flags += 'd'; // DP relative
-    else
-      Flags += 'c'; // CP relative
-  }
-
-  Flags += "\",";
-  
-  Flags += '@';
-
-  if (flags & SectionFlags::BSS)
-    Flags += "nobits";
-  else
-    Flags += "progbits";
-
-  if (unsigned entitySize = SectionFlags::getEntitySize(flags))
-    Flags += "," + utostr(entitySize);
-
-  return Flags;
-}
index 79fd36aa23ce5c9c15fb3df87ca35e122acd5c1e..a1e11fe78685f4604f6496796edfd36646a540e3 100644 (file)
@@ -29,12 +29,7 @@ namespace llvm {
     explicit XCoreTargetAsmInfo(const XCoreTargetMachine &TM);
     
     virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
-    virtual std::string printSectionFlags(unsigned flags) const;
-    const Section* MergeableConstSection(const GlobalVariable *GV) const;
-    inline const Section* MergeableConstSection(const Type *Ty) const;
-    const Section* MergeableStringSection(const GlobalVariable *GV) const;
-    virtual const Section*
-    SelectSectionForMachineConst(const Type *Ty) const;
+    const Section* MergeableConstSection(const Type *Ty) const;
     virtual unsigned
     SectionFlagsForGlobal(const GlobalValue *GV = NULL,
                           const char* name = NULL) const;