[llvm-commits] [llvm] r76653 - in /llvm/trunk: include/llvm/Target/ELFTargetAsmInfo.h lib/Target/ELFTargetAsmInfo.cpp lib/Target/XCore/XCoreTargetAsmInfo.cpp lib/Target/XCore/XCoreTargetAsmInfo.h

Chris Lattner sabre at nondot.org
Tue Jul 21 14:26:32 PDT 2009


Author: lattner
Date: Tue Jul 21 16:26:32 2009
New Revision: 76653

URL: http://llvm.org/viewvc/llvm-project?rev=76653&view=rev
Log:
Remove some overridden functions in XCoreTargetAsmInfo that are
implemented exactly the same way as its ELFTargetAsmInfo subclass 
has them.

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

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

==============================================================================
--- llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h Tue Jul 21 16:26:32 2009
@@ -29,7 +29,7 @@
     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;

Modified: llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp?rev=76653&r1=76652&r2=76653&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp Tue Jul 21 16:26:32 2009
@@ -142,11 +142,10 @@
 
 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();
 

Modified: llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp?rev=76653&r1=76652&r2=76653&view=diff

==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp Tue Jul 21 16:26:32 2009
@@ -72,12 +72,9 @@
 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 @@
 }
 
 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 @@
   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 @@
 
   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;
-}

Modified: llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.h?rev=76653&r1=76652&r2=76653&view=diff

==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.h (original)
+++ llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.h Tue Jul 21 16:26:32 2009
@@ -29,12 +29,7 @@
     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;





More information about the llvm-commits mailing list