llvm.org GIT mirror llvm / 315690e
Get rid of duplicate char*/Section* DataSection git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56575 91177308-0d34-0410-b5e6-96231b3b80d8 Anton Korobeynikov 11 years ago
9 changed file(s) with 17 addition(s) and 23 deletion(s). Raw diff Collapse all Expand all
130130
131131 /// TextSection - Section directive for standard text.
132132 ///
133 const Section *TextSection; // Defaults to ".text".
133 const Section *TextSection; // Defaults to ".text".
134134
135135 /// DataSection - Section directive for standard data.
136136 ///
137 const char *DataSection; // Defaults to ".data".
138 const Section *DataSection_;
137 const Section *DataSection; // Defaults to ".data".
139138
140139 /// BSSSection - Section directive for uninitialized data. Null if this
141140 /// target doesn't support a BSS section.
600599 const Section *getTextSection() const {
601600 return TextSection;
602601 }
603 const char *getDataSection() const {
602 const Section *getDataSection() const {
604603 return DataSection;
605 }
606 const Section *getDataSection_() const {
607 return DataSection_;
608604 }
609605 const char *getBSSSection() const {
610606 return BSSSection;
20632063
20642064 Asm->SwitchToSection(TAI->getTextSection());
20652065 EmitLabel("text_begin", 0);
2066 Asm->SwitchToDataSection(TAI->getDataSection());
2066 Asm->SwitchToSection(TAI->getDataSection());
20672067 EmitLabel("data_begin", 0);
20682068 }
20692069
27492749 // Standard sections final addresses.
27502750 Asm->SwitchToSection(TAI->getTextSection());
27512751 EmitLabel("text_end", 0);
2752 Asm->SwitchToDataSection(TAI->getDataSection());
2752 Asm->SwitchToSection(TAI->getDataSection());
27532753 EmitLabel("data_end", 0);
27542754
27552755 // End text sections.
6464 AP.SwitchToSection(TAI.getTextSection());
6565 EmitCamlGlobal(getModule(), OS, AP, TAI, "code_begin");
6666
67 AP.SwitchToDataSection(TAI.getDataSection());
67 AP.SwitchToSection(TAI.getDataSection());
6868 EmitCamlGlobal(getModule(), OS, AP, TAI, "data_begin");
6969 }
7070
9999 AP.SwitchToSection(TAI.getTextSection());
100100 EmitCamlGlobal(getModule(), OS, AP, TAI, "code_end");
101101
102 AP.SwitchToDataSection(TAI.getDataSection());
102 AP.SwitchToSection(TAI.getDataSection());
103103 EmitCamlGlobal(getModule(), OS, AP, TAI, "data_end");
104104
105105 OS << AddressDirective << 0; // FIXME: Why does ocaml emit this??
106106 AP.EOL();
107107
108 AP.SwitchToDataSection(TAI.getDataSection());
108 AP.SwitchToSection(TAI.getDataSection());
109109 EmitCamlGlobal(getModule(), OS, AP, TAI, "frametable");
110110
111111 for (iterator I = begin(), IE = end(); I != IE; ++I) {
4747 AlignmentIsInBytes = false;
4848 Data64bitsDirective = 0;
4949 CommentString = "@";
50 DataSection = "\t.data";
5150 ConstantPoolSection = "\t.text\n";
5251 COMMDirectiveTakesAlignment = false;
5352 InlineAsmStart = "@ InlineAsm Start";
8989 if (cast(GV)->isConstant())
9090 return (isWeak ? ConstDataCoalSection : ConstDataSection);
9191 else
92 return (isWeak ? DataCoalSection : getDataSection_());
92 return (isWeak ? DataCoalSection : getDataSection());
9393 case SectionKind::ROData:
9494 return (isWeak ? ConstDataCoalSection :
9595 (isNonStatic ? ConstDataSection : getReadOnlySection_()));
2626 ELFTargetAsmInfo::ELFTargetAsmInfo(const TargetMachine &TM) {
2727 ETM = &TM;
2828
29 DataSection_ = getUnnamedSection("\t.data", SectionFlags::Writeable);
3029 BSSSection_ = getUnnamedSection("\t.bss",
3130 SectionFlags::Writeable | SectionFlags::BSS);
3231 ReadOnlySection_ = getNamedSection("\t.rodata", SectionFlags::None);
6362 switch (Kind) {
6463 case SectionKind::Data:
6564 case SectionKind::SmallData:
66 return getDataSection_();
65 return getDataSection();
6766 case SectionKind::BSS:
6867 case SectionKind::SmallBSS:
6968 // ELF targets usually have BSS sections
2626
2727 TargetAsmInfo::TargetAsmInfo() :
2828 TextSection(0),
29 DataSection("\t.data"),
30 DataSection_(0),
29 DataSection(0),
3130 BSSSection("\t.bss"),
3231 BSSSection_(0),
3332 ReadOnlySection(0),
125124 DwarfExceptionSection(".gcc_except_table"),
126125 AsmTransCBE(0) {
127126 TextSection = getUnnamedSection("\t.text", SectionFlags::Code);
128 DataSection_ = getUnnamedSection(DataSection);
127 DataSection = getUnnamedSection("\t.data", SectionFlags::Writeable);
129128 }
130129
131130 TargetAsmInfo::~TargetAsmInfo() {
305304 return getReadOnlySection_();
306305 }
307306
308 return getDataSection_();
307 return getDataSection();
309308 }
310309
311310 // Lame default implementation. Calculate the section name for machine const.
312311 const Section*
313312 TargetAsmInfo::SelectSectionForMachineConst(const Type *Ty) const {
314313 // FIXME: Support data.rel stuff someday
315 return getDataSection_();
314 return getDataSection();
316315 }
317316
318317 std::string
480480 O << "\tpublic " << name << "\n";
481481 // FALL THROUGH
482482 case GlobalValue::InternalLinkage:
483 SwitchToDataSection(TAI->getDataSection(), I);
483 SwitchToSection(TAI->getDataSection());
484484 break;
485485 default:
486486 assert(0 && "Unknown linkage type!");
433433 HasDotTypeDotSizeDirective = false;
434434
435435 TextSection = getUnnamedSection("_text", SectionFlags::Code);
436 DataSection = "_data";
436 DataSection = getUnnamedSection("_data", SectionFlags::Writeable);
437
437438 JumpTableDataSection = NULL;
438439 SwitchToSectionDirective = "";
439440 TextSectionStartSuffix = "\tsegment 'CODE'";