Get rid of duplicate char*/Section* stuff for TLS sections
authorAnton Korobeynikov <asl@math.spbu.ru>
Wed, 24 Sep 2008 22:17:06 +0000 (22:17 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Wed, 24 Sep 2008 22:17:06 +0000 (22:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56577 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetAsmInfo.h
lib/Target/ARM/ARMTargetAsmInfo.cpp
lib/Target/ELFTargetAsmInfo.cpp
lib/Target/TargetAsmInfo.cpp

index 99ae1832f8c1249becf8fed9f8343fe5d4664c5e..e1484e5faf1da09ee1fa70caceeda891a343b229 100644 (file)
@@ -166,14 +166,12 @@ namespace llvm {
 
     /// TLSDataSection - Section directive for Thread Local data.
     ///
-    const char *TLSDataSection;// Defaults to ".section .tdata,"awT",@progbits".
-    const Section *TLSDataSection_;
+    const Section *TLSDataSection;        // Defaults to ".tdata".
 
     /// TLSBSSSection - Section directive for Thread Local uninitialized data.
     /// Null if this target doesn't support a BSS section.
     ///
-    const char *TLSBSSSection;// Default to ".section .tbss,"awT",@nobits".
-    const Section *TLSBSSSection_;
+    const Section *TLSBSSSection;         // Defaults to ".tbss".
 
     /// ZeroFillDirective - Directive for emitting a global to the ZeroFill
     /// section on this target.  Null if this target doesn't support zerofill.
@@ -624,18 +622,12 @@ namespace llvm {
     const Section *getSmallRODataSection() const {
       return SmallRODataSection;
     }
-    const char *getTLSDataSection() const {
+    const Section *getTLSDataSection() const {
       return TLSDataSection;
     }
-    const Section *getTLSDataSection_() const {
-      return TLSDataSection_;
-    }
-    const char *getTLSBSSSection() const {
+    const Section *getTLSBSSSection() const {
       return TLSBSSSection;
     }
-    const Section *getTLSBSSSection_() const {
-      return TLSBSSSection_;
-    }
     const char *getZeroFillDirective() const {
       return ZeroFillDirective;
     }
index d41f350240063da20af319c1f9b598dc27aa9694..3686da8859a4500a2ccf011e3f0e2b37c739fc74 100644 (file)
@@ -141,8 +141,6 @@ ARMELFTargetAsmInfo::ARMELFTargetAsmInfo(const ARMTargetMachine &TM):
     StaticCtorsSection = "\t.section .ctors,\"aw\",%progbits";
     StaticDtorsSection = "\t.section .dtors,\"aw\",%progbits";
   }
-  TLSDataSection = "\t.section .tdata,\"awT\",%progbits";
-  TLSBSSSection = "\t.section .tbss,\"awT\",%nobits";
 }
 
 /// Count the number of comma-separated arguments.
index 784d9cdbc522bc63ab1ecf7371b2615c7f0d75ac..b9e9812575975bef3272ad43b76efd44c624859b 100644 (file)
@@ -30,9 +30,9 @@ ELFTargetAsmInfo::ELFTargetAsmInfo(const TargetMachine &TM) {
   BSSSection_  = getUnnamedSection("\t.bss",
                                    SectionFlags::Writeable | SectionFlags::BSS);
   ReadOnlySection_ = getNamedSection("\t.rodata", SectionFlags::None);
-  TLSDataSection_ = getNamedSection("\t.tdata",
-                                    SectionFlags::Writeable | SectionFlags::TLS);
-  TLSBSSSection_ = getNamedSection("\t.tbss",
+  TLSDataSection = getNamedSection("\t.tdata",
+                                   SectionFlags::Writeable | SectionFlags::TLS);
+  TLSBSSSection = getNamedSection("\t.tbss",
                 SectionFlags::Writeable | SectionFlags::TLS | SectionFlags::BSS);
 
 }
@@ -77,9 +77,9 @@ ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
         return MergeableConstSection(GVar);
        case SectionKind::ThreadData:
         // ELF targets usually support TLS stuff
-        return getTLSDataSection_();
+        return TLSDataSection;
        case SectionKind::ThreadBSS:
-        return getTLSBSSSection_();
+        return TLSBSSSection;
        default:
         assert(0 && "Unsuported section kind for global");
       }
index e963d7116ae8dfabc84b6eb212dee6178bcb8d9a..d85e5987570527b5b9a1fad50a0e10903005c0cf 100644 (file)
@@ -35,10 +35,8 @@ TargetAsmInfo::TargetAsmInfo() :
   SmallDataSection(0),
   SmallBSSSection(0),
   SmallRODataSection(0),
-  TLSDataSection("\t.section .tdata,\"awT\",@progbits"),
-  TLSDataSection_(0),
-  TLSBSSSection("\t.section .tbss,\"awT\",@nobits"),
-  TLSBSSSection_(0),
+  TLSDataSection(0),
+  TLSBSSSection(0),
   ZeroFillDirective(0),
   NonexecutableStackDirective(0),
   NeedsSet(false),