summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-09-24 22:20:27 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-09-24 22:20:27 +0000
commit8e7b93938de9bf4e6d2bcb6cb2aa6f7533aa2600 (patch)
tree2fb4e1d425240590c386744bad3ab741a53ef1ae
parent91a6705839f1da638f7b0834434e83b4b1a4b570 (diff)
downloadbcm5719-llvm-8e7b93938de9bf4e6d2bcb6cb2aa6f7533aa2600.tar.gz
bcm5719-llvm-8e7b93938de9bf4e6d2bcb6cb2aa6f7533aa2600.zip
Get rid of ReadOnlySection duplicate
llvm-svn: 56582
-rw-r--r--llvm/include/llvm/Target/TargetAsmInfo.h8
-rw-r--r--llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp2
-rw-r--r--llvm/lib/Target/DarwinTargetAsmInfo.cpp12
-rw-r--r--llvm/lib/Target/ELFTargetAsmInfo.cpp8
-rw-r--r--llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp6
-rw-r--r--llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp2
-rw-r--r--llvm/lib/Target/TargetAsmInfo.cpp5
-rw-r--r--llvm/lib/Target/X86/X86TargetAsmInfo.cpp3
8 files changed, 17 insertions, 29 deletions
diff --git a/llvm/include/llvm/Target/TargetAsmInfo.h b/llvm/include/llvm/Target/TargetAsmInfo.h
index 0d5d7cd2c40..c93d189cc65 100644
--- a/llvm/include/llvm/Target/TargetAsmInfo.h
+++ b/llvm/include/llvm/Target/TargetAsmInfo.h
@@ -146,8 +146,7 @@ namespace llvm {
/// ReadOnlySection - This is the directive that is emitted to switch to a
/// read-only section for constant data (e.g. data declared const,
/// jump tables).
- const char *ReadOnlySection; // Defaults to NULL
- const Section *ReadOnlySection_;
+ const Section *ReadOnlySection; // Defaults to NULL
/// SmallDataSection - This is the directive that is emitted to switch to a
/// small data section.
@@ -597,12 +596,9 @@ namespace llvm {
const Section *getBSSSection_() const {
return BSSSection_;
}
- const char *getReadOnlySection() const {
+ const Section *getReadOnlySection() const {
return ReadOnlySection;
}
- const Section *getReadOnlySection_() const {
- return ReadOnlySection_;
- }
const Section *getSmallDataSection() const {
return SmallDataSection;
}
diff --git a/llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp b/llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp
index 96451ada1f6..7afbab344b8 100644
--- a/llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp
@@ -72,7 +72,6 @@ ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo(const ARMTargetMachine &TM):
ProtectedDirective = NULL;
JumpTableDataSection = ".const";
CStringSection = "\t.cstring";
- ReadOnlySection = "\t.const\n";
HasDotTypeDotSizeDirective = false;
NeedsIndirectEncoding = true;
if (TM.getRelocationModel() == Reloc::Static) {
@@ -112,7 +111,6 @@ ARMELFTargetAsmInfo::ARMELFTargetAsmInfo(const ARMTargetMachine &TM):
HasLEB128 = true;
AbsoluteDebugSectionOffsets = true;
CStringSection = ".rodata.str";
- ReadOnlySection = "\t.section\t.rodata\n";
PrivateGlobalPrefix = ".L";
WeakRefDirective = "\t.weak\t";
SetDirective = "\t.set\t";
diff --git a/llvm/lib/Target/DarwinTargetAsmInfo.cpp b/llvm/lib/Target/DarwinTargetAsmInfo.cpp
index 55d0c429c75..7de89003656 100644
--- a/llvm/lib/Target/DarwinTargetAsmInfo.cpp
+++ b/llvm/lib/Target/DarwinTargetAsmInfo.cpp
@@ -38,12 +38,12 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo(const TargetMachine &TM) {
// there, if needed.
SixteenByteConstantSection = 0;
- ReadOnlySection_ = getUnnamedSection("\t.const\n", SectionFlags::None);
+ ReadOnlySection = getUnnamedSection("\t.const\n", SectionFlags::None);
TextCoalSection =
getNamedSection("\t__TEXT,__textcoal_nt,coalesced,pure_instructions",
SectionFlags::Code);
- ConstDataCoalSection = getBamedSection("\t__DATA,__const_coal,coalesced",
+ ConstDataCoalSection = getNamedSection("\t__DATA,__const_coal,coalesced",
SectionFlags::None);
ConstDataSection = getUnnamedSection(".const_data", SectionFlags::None);
DataCoalSection = getNamedSection("\t__DATA,__datacoal_nt,coalesced",
@@ -92,7 +92,7 @@ DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
return (isWeak ? DataCoalSection : DataSection);
case SectionKind::ROData:
return (isWeak ? ConstDataCoalSection :
- (isNonStatic ? ConstDataSection : getReadOnlySection_()));
+ (isNonStatic ? ConstDataSection : getReadOnlySection()));
case SectionKind::RODataMergeStr:
return (isWeak ?
ConstDataCoalSection :
@@ -122,7 +122,7 @@ DarwinTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const {
return getCStringSection_();
}
- return getReadOnlySection_();
+ return getReadOnlySection();
}
const Section*
@@ -144,7 +144,7 @@ DarwinTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
else if (Size == 16 && SixteenByteConstantSection)
return SixteenByteConstantSection;
- return getReadOnlySection_();
+ return getReadOnlySection();
}
const Section*
@@ -152,7 +152,7 @@ DarwinTargetAsmInfo::SelectSectionForMachineConst(const Type *Ty) const {
const Section* S = MergeableConstSection(Ty);
// Handle weird special case, when compiling PIC stuff.
- if (S == getReadOnlySection_() &&
+ if (S == getReadOnlySection() &&
DTM->getRelocationModel() != Reloc::Static)
return ConstDataSection;
diff --git a/llvm/lib/Target/ELFTargetAsmInfo.cpp b/llvm/lib/Target/ELFTargetAsmInfo.cpp
index 7c9e4546d25..7457e0827c3 100644
--- a/llvm/lib/Target/ELFTargetAsmInfo.cpp
+++ b/llvm/lib/Target/ELFTargetAsmInfo.cpp
@@ -29,7 +29,7 @@ ELFTargetAsmInfo::ELFTargetAsmInfo(const TargetMachine &TM) {
BSSSection_ = getUnnamedSection("\t.bss",
SectionFlags::Writeable | SectionFlags::BSS);
- ReadOnlySection_ = getNamedSection("\t.rodata", SectionFlags::None);
+ ReadOnlySection = getNamedSection("\t.rodata", SectionFlags::None);
TLSDataSection = getNamedSection("\t.tdata",
SectionFlags::Writeable | SectionFlags::TLS);
TLSBSSSection = getNamedSection("\t.tbss",
@@ -70,7 +70,7 @@ ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
return getBSSSection_();
case SectionKind::ROData:
case SectionKind::SmallROData:
- return getReadOnlySection_();
+ return getReadOnlySection();
case SectionKind::RODataMergeStr:
return MergeableStringSection(GVar);
case SectionKind::RODataMergeConst:
@@ -116,7 +116,7 @@ ELFTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
Size));
}
- return getReadOnlySection_();
+ return getReadOnlySection();
}
const Section*
@@ -143,7 +143,7 @@ ELFTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const {
return getNamedSection(Name.c_str(), Flags);
}
- return getReadOnlySection_();
+ return getReadOnlySection();
}
std::string ELFTargetAsmInfo::printSectionFlags(unsigned flags) const {
diff --git a/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp b/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp
index 5c5d7cacdd8..4d2881e09b5 100644
--- a/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp
+++ b/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp
@@ -30,7 +30,6 @@ MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM):
PrivateGlobalPrefix = "$";
JumpTableDataSection = "\t.rdata";
CommentString = "#";
- ReadOnlySection = "\t.rdata";
ZeroDirective = "\t.space\t";
BSSSection = "\t.section\t.bss";
CStringSection = ".rodata.str";
@@ -38,9 +37,10 @@ MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM):
if (!Subtarget->hasABICall()) {
JumpTableDirective = "\t.word\t";
SmallDataSection = getNamedSection("\t.sdata", SectionFlags::Writeable);
- SmallBSSSection = getNamedSection("\t.sbss", SectionFlags::Writeable |
+ SmallBSSSection = getNamedSection("\t.sbss",
+ SectionFlags::Writeable |
SectionFlags::BSS);
- } else
+ } else
JumpTableDirective = "\t.gpword\t";
}
diff --git a/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp b/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
index 89800247589..6988e78196f 100644
--- a/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
+++ b/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
@@ -43,7 +43,6 @@ PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM):
ConstantPoolSection = "\t.const\t";
JumpTableDataSection = ".const";
CStringSection = "\t.cstring";
- ReadOnlySection = "\t.const\n";
if (TM.getRelocationModel() == Reloc::Static) {
StaticCtorsSection = ".constructor";
StaticDtorsSection = ".destructor";
@@ -137,7 +136,6 @@ PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) :
DwarfRangesSection = "\t.section\t.debug_ranges,\"\",@progbits";
DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"\",@progbits";
- ReadOnlySection = "\t.section\t.rodata";
PCSymbol = ".";
// Set up DWARF directives
diff --git a/llvm/lib/Target/TargetAsmInfo.cpp b/llvm/lib/Target/TargetAsmInfo.cpp
index ab4db2af3ee..1c883ada90c 100644
--- a/llvm/lib/Target/TargetAsmInfo.cpp
+++ b/llvm/lib/Target/TargetAsmInfo.cpp
@@ -31,7 +31,6 @@ TargetAsmInfo::TargetAsmInfo() :
BSSSection("\t.bss"),
BSSSection_(0),
ReadOnlySection(0),
- ReadOnlySection_(0),
SmallDataSection(0),
SmallBSSSection(0),
SmallRODataSection(0),
@@ -293,8 +292,8 @@ TargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
return getTextSection();
else if (isBSS(Kind) && getBSSSection_())
return getBSSSection_();
- else if (getReadOnlySection_() && SectionKind::isReadOnly(Kind))
- return getReadOnlySection_();
+ else if (getReadOnlySection() && SectionKind::isReadOnly(Kind))
+ return getReadOnlySection();
}
return getDataSection();
diff --git a/llvm/lib/Target/X86/X86TargetAsmInfo.cpp b/llvm/lib/Target/X86/X86TargetAsmInfo.cpp
index 1097302ca7e..c6a76f210ae 100644
--- a/llvm/lib/Target/X86/X86TargetAsmInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetAsmInfo.cpp
@@ -150,8 +150,6 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM):
SixteenByteConstantSection = getUnnamedSection("\t.literal16\n",
SectionFlags::Mergeable);
}
- ReadOnlySection = "\t.const\n";
-
LCOMMDirective = "\t.lcomm\t";
SwitchToSectionDirective = "\t.section ";
StringConstantPrefix = "\1LC";
@@ -229,7 +227,6 @@ X86DarwinTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason,
X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const X86TargetMachine &TM):
X86TargetAsmInfo(TM), ELFTargetAsmInfo(TM) {
- ReadOnlySection = ".rodata";
CStringSection = ".rodata.str";
PrivateGlobalPrefix = ".L";
WeakRefDirective = "\t.weak\t";
OpenPOWER on IntegriCloud