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

Chris Lattner sabre at nondot.org
Tue Jul 21 15:42:37 PDT 2009


Author: lattner
Date: Tue Jul 21 17:42:37 2009
New Revision: 76667

URL: http://llvm.org/viewvc/llvm-project?rev=76667&view=rev
Log:
remove the last bits of SectionFlagsForGlobal.  There is some flag here that
depends on XS1A, but I think the ReadOnlySection is already set up for this
and there is no testcase that this breaks.  If this is really needed, we can
add the appropriate parameterization to TargetAsmInfo in the future to support
this.

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

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

==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp Tue Jul 21 17:42:37 2009
@@ -22,15 +22,14 @@
 using namespace llvm;
 
 XCoreTargetAsmInfo::XCoreTargetAsmInfo(const XCoreTargetMachine &TM)
-  : ELFTargetAsmInfo(TM),
-    Subtarget(TM.getSubtargetImpl()) {
+  : ELFTargetAsmInfo(TM) {
   SupportsDebugInformation = true;
   TextSection = getUnnamedSection("\t.text", SectionFlags::Code);
   DataSection = getNamedSection("\t.dp.data", SectionFlags::Writeable |
                                 SectionFlags::Small);
   BSSSection_  = getNamedSection("\t.dp.bss", SectionFlags::Writeable |
                                  SectionFlags::BSS | SectionFlags::Small);
-  if (Subtarget->isXS1A()) {
+  if (TM.getSubtargetImpl()->isXS1A()) {
     ReadOnlySection = getNamedSection("\t.dp.rodata", SectionFlags::None |
                                       SectionFlags::Writeable |
                                       SectionFlags::Small);
@@ -68,24 +67,3 @@
   DwarfMacroInfoSection = "\t.section\t.debug_macinfo,\"\", at progbits";
 }
 
-unsigned XCoreTargetAsmInfo::
-SectionFlagsForGlobal(const GlobalValue *GV, const char* Name) const {
-  unsigned Flags = ELFTargetAsmInfo::SectionFlagsForGlobal(GV, Name);
-
-  // Set CP / DP relative flags
-  if (GV) {
-    SectionKind::Kind Kind = SectionKindForGlobal(GV);
-    switch (Kind) {
-    case SectionKind::ROData:
-    case SectionKind::RODataMergeStr:
-    case SectionKind::SmallROData:
-      if (Subtarget->isXS1A())
-        Flags |= SectionFlags::Writeable;
-      break;
-    default:
-      break;
-    }
-  }
-
-  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=76667&r1=76666&r2=76667&view=diff

==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.h (original)
+++ llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.h Tue Jul 21 17:42:37 2009
@@ -23,14 +23,8 @@
   class XCoreSubtarget;
 
   class XCoreTargetAsmInfo : public ELFTargetAsmInfo {
-  private:
-    const XCoreSubtarget *Subtarget;
   public:
     explicit XCoreTargetAsmInfo(const XCoreTargetMachine &TM);
-    
-    virtual unsigned
-    SectionFlagsForGlobal(const GlobalValue *GV = NULL,
-                          const char* name = NULL) const;
   };
 
 } // namespace llvm





More information about the llvm-commits mailing list