forked from OSchip/llvm-project
				
			Get rid of duplicate char*/Section* stuff for TLS sections
llvm-svn: 56577
This commit is contained in:
		
							parent
							
								
									1f365bbf55
								
							
						
					
					
						commit
						22db30548d
					
				| 
						 | 
					@ -166,14 +166,12 @@ namespace llvm {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /// TLSDataSection - Section directive for Thread Local data.
 | 
					    /// TLSDataSection - Section directive for Thread Local data.
 | 
				
			||||||
    ///
 | 
					    ///
 | 
				
			||||||
    const char *TLSDataSection;// Defaults to ".section .tdata,"awT",@progbits".
 | 
					    const Section *TLSDataSection;        // Defaults to ".tdata".
 | 
				
			||||||
    const Section *TLSDataSection_;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /// TLSBSSSection - Section directive for Thread Local uninitialized data.
 | 
					    /// TLSBSSSection - Section directive for Thread Local uninitialized data.
 | 
				
			||||||
    /// Null if this target doesn't support a BSS section.
 | 
					    /// Null if this target doesn't support a BSS section.
 | 
				
			||||||
    ///
 | 
					    ///
 | 
				
			||||||
    const char *TLSBSSSection;// Default to ".section .tbss,"awT",@nobits".
 | 
					    const Section *TLSBSSSection;         // Defaults to ".tbss".
 | 
				
			||||||
    const Section *TLSBSSSection_;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /// ZeroFillDirective - Directive for emitting a global to the ZeroFill
 | 
					    /// ZeroFillDirective - Directive for emitting a global to the ZeroFill
 | 
				
			||||||
    /// section on this target.  Null if this target doesn't support zerofill.
 | 
					    /// section on this target.  Null if this target doesn't support zerofill.
 | 
				
			||||||
| 
						 | 
					@ -624,18 +622,12 @@ namespace llvm {
 | 
				
			||||||
    const Section *getSmallRODataSection() const {
 | 
					    const Section *getSmallRODataSection() const {
 | 
				
			||||||
      return SmallRODataSection;
 | 
					      return SmallRODataSection;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    const char *getTLSDataSection() const {
 | 
					    const Section *getTLSDataSection() const {
 | 
				
			||||||
      return TLSDataSection;
 | 
					      return TLSDataSection;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    const Section *getTLSDataSection_() const {
 | 
					    const Section *getTLSBSSSection() const {
 | 
				
			||||||
      return TLSDataSection_;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    const char *getTLSBSSSection() const {
 | 
					 | 
				
			||||||
      return TLSBSSSection;
 | 
					      return TLSBSSSection;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    const Section *getTLSBSSSection_() const {
 | 
					 | 
				
			||||||
      return TLSBSSSection_;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    const char *getZeroFillDirective() const {
 | 
					    const char *getZeroFillDirective() const {
 | 
				
			||||||
      return ZeroFillDirective;
 | 
					      return ZeroFillDirective;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -141,8 +141,6 @@ ARMELFTargetAsmInfo::ARMELFTargetAsmInfo(const ARMTargetMachine &TM):
 | 
				
			||||||
    StaticCtorsSection = "\t.section .ctors,\"aw\",%progbits";
 | 
					    StaticCtorsSection = "\t.section .ctors,\"aw\",%progbits";
 | 
				
			||||||
    StaticDtorsSection = "\t.section .dtors,\"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.
 | 
					/// Count the number of comma-separated arguments.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -30,9 +30,9 @@ ELFTargetAsmInfo::ELFTargetAsmInfo(const TargetMachine &TM) {
 | 
				
			||||||
  BSSSection_  = getUnnamedSection("\t.bss",
 | 
					  BSSSection_  = getUnnamedSection("\t.bss",
 | 
				
			||||||
                                   SectionFlags::Writeable | SectionFlags::BSS);
 | 
					                                   SectionFlags::Writeable | SectionFlags::BSS);
 | 
				
			||||||
  ReadOnlySection_ = getNamedSection("\t.rodata", SectionFlags::None);
 | 
					  ReadOnlySection_ = getNamedSection("\t.rodata", SectionFlags::None);
 | 
				
			||||||
  TLSDataSection_ = getNamedSection("\t.tdata",
 | 
					  TLSDataSection = getNamedSection("\t.tdata",
 | 
				
			||||||
                                    SectionFlags::Writeable | SectionFlags::TLS);
 | 
					                                   SectionFlags::Writeable | SectionFlags::TLS);
 | 
				
			||||||
  TLSBSSSection_ = getNamedSection("\t.tbss",
 | 
					  TLSBSSSection = getNamedSection("\t.tbss",
 | 
				
			||||||
                SectionFlags::Writeable | SectionFlags::TLS | SectionFlags::BSS);
 | 
					                SectionFlags::Writeable | SectionFlags::TLS | SectionFlags::BSS);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -77,9 +77,9 @@ ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
 | 
				
			||||||
        return MergeableConstSection(GVar);
 | 
					        return MergeableConstSection(GVar);
 | 
				
			||||||
       case SectionKind::ThreadData:
 | 
					       case SectionKind::ThreadData:
 | 
				
			||||||
        // ELF targets usually support TLS stuff
 | 
					        // ELF targets usually support TLS stuff
 | 
				
			||||||
        return getTLSDataSection_();
 | 
					        return TLSDataSection;
 | 
				
			||||||
       case SectionKind::ThreadBSS:
 | 
					       case SectionKind::ThreadBSS:
 | 
				
			||||||
        return getTLSBSSSection_();
 | 
					        return TLSBSSSection;
 | 
				
			||||||
       default:
 | 
					       default:
 | 
				
			||||||
        assert(0 && "Unsuported section kind for global");
 | 
					        assert(0 && "Unsuported section kind for global");
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,10 +35,8 @@ TargetAsmInfo::TargetAsmInfo() :
 | 
				
			||||||
  SmallDataSection(0),
 | 
					  SmallDataSection(0),
 | 
				
			||||||
  SmallBSSSection(0),
 | 
					  SmallBSSSection(0),
 | 
				
			||||||
  SmallRODataSection(0),
 | 
					  SmallRODataSection(0),
 | 
				
			||||||
  TLSDataSection("\t.section .tdata,\"awT\",@progbits"),
 | 
					  TLSDataSection(0),
 | 
				
			||||||
  TLSDataSection_(0),
 | 
					  TLSBSSSection(0),
 | 
				
			||||||
  TLSBSSSection("\t.section .tbss,\"awT\",@nobits"),
 | 
					 | 
				
			||||||
  TLSBSSSection_(0),
 | 
					 | 
				
			||||||
  ZeroFillDirective(0),
 | 
					  ZeroFillDirective(0),
 | 
				
			||||||
  NonexecutableStackDirective(0),
 | 
					  NonexecutableStackDirective(0),
 | 
				
			||||||
  NeedsSet(false),
 | 
					  NeedsSet(false),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue