summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-01 21:56:13 +0000
committerChris Lattner <sabre@nondot.org>2009-08-01 21:56:13 +0000
commitd5c01136ef003e4b2de85d18d9897fab621e1c14 (patch)
tree5fd40da17c0e3de120145e6ef8206af5424a8a4d /llvm/lib/Target
parent286326ed24d5f480f02a980543da425eb36b5e89 (diff)
downloadbcm5719-llvm-d5c01136ef003e4b2de85d18d9897fab621e1c14.tar.gz
bcm5719-llvm-d5c01136ef003e4b2de85d18d9897fab621e1c14.zip
fix a fixme by sinking various target-specific directives down into
the appropriate subclasses. llvm-svn: 77815
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/PIC16/PIC16TargetObjectFile.cpp4
-rw-r--r--llvm/lib/Target/TargetLoweringObjectFile.cpp29
2 files changed, 15 insertions, 18 deletions
diff --git a/llvm/lib/Target/PIC16/PIC16TargetObjectFile.cpp b/llvm/lib/Target/PIC16/PIC16TargetObjectFile.cpp
index 78e88ca935c..04f2ebf1133 100644
--- a/llvm/lib/Target/PIC16/PIC16TargetObjectFile.cpp
+++ b/llvm/lib/Target/PIC16/PIC16TargetObjectFile.cpp
@@ -19,8 +19,8 @@ void PIC16TargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &tm){
TargetLoweringObjectFile::Initialize(Ctx, tm);
TM = &tm;
- BSSSection_ = getOrCreateSection("udata.# UDATA", false,
- SectionKind::get(SectionKind::BSS));
+ BSSSection = getOrCreateSection("udata.# UDATA", false,
+ SectionKind::get(SectionKind::BSS));
ReadOnlySection = getOrCreateSection("romdata.# ROMDATA", false,
SectionKind::get(SectionKind::ReadOnly));
DataSection = getOrCreateSection("idata.# IDATA", false,
diff --git a/llvm/lib/Target/TargetLoweringObjectFile.cpp b/llvm/lib/Target/TargetLoweringObjectFile.cpp
index a26bec2bdf7..84247790f45 100644
--- a/llvm/lib/Target/TargetLoweringObjectFile.cpp
+++ b/llvm/lib/Target/TargetLoweringObjectFile.cpp
@@ -32,11 +32,8 @@ using namespace llvm;
TargetLoweringObjectFile::TargetLoweringObjectFile() : Ctx(0) {
TextSection = 0;
DataSection = 0;
- BSSSection_ = 0;
+ BSSSection = 0;
ReadOnlySection = 0;
- TLSDataSection = 0;
- TLSBSSSection = 0;
- CStringSection_ = 0;
}
TargetLoweringObjectFile::~TargetLoweringObjectFile() {
@@ -222,8 +219,8 @@ TargetLoweringObjectFile::SelectSectionForGlobal(const GlobalValue *GV,
if (Kind.isText())
return getTextSection();
- if (Kind.isBSS() && BSSSection_ != 0)
- return BSSSection_;
+ if (Kind.isBSS() && BSSSection != 0)
+ return BSSSection;
if (Kind.isReadOnly() && ReadOnlySection != 0)
return ReadOnlySection;
@@ -261,16 +258,16 @@ void TargetLoweringObjectFileELF::Initialize(MCContext &Ctx,
const TargetMachine &TM) {
TargetLoweringObjectFile::Initialize(Ctx, TM);
if (!HasCrazyBSS)
- BSSSection_ = getOrCreateSection("\t.bss", true,
- SectionKind::get(SectionKind::BSS));
+ BSSSection = getOrCreateSection("\t.bss", true,
+ SectionKind::get(SectionKind::BSS));
else
// PPC/Linux doesn't support the .bss directive, it needs .section .bss.
// FIXME: Does .section .bss work everywhere??
// FIXME2: this should just be handle by the section printer. We should get
// away from syntactic view of the sections and MCSection should just be a
// semantic view.
- BSSSection_ = getOrCreateSection("\t.bss", false,
- SectionKind::get(SectionKind::BSS));
+ BSSSection = getOrCreateSection("\t.bss", false,
+ SectionKind::get(SectionKind::BSS));
TextSection = getOrCreateSection("\t.text", true,
@@ -283,7 +280,7 @@ void TargetLoweringObjectFileELF::Initialize(MCContext &Ctx,
TLSDataSection =
getOrCreateSection("\t.tdata", false,
SectionKind::get(SectionKind::ThreadData));
- CStringSection_ = getOrCreateSection("\t.rodata.str", true,
+ CStringSection = getOrCreateSection("\t.rodata.str", true,
SectionKind::get(SectionKind::MergeableCString));
TLSBSSSection = getOrCreateSection("\t.tbss", false,
@@ -423,7 +420,7 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
if (Kind.isText()) return TextSection;
if (Kind.isMergeableCString()) {
- assert(CStringSection_ && "Should have string section prefix");
+ assert(CStringSection && "Should have string section prefix");
// We also need alignment here.
// FIXME: this is getting the alignment of the character, not the
@@ -431,7 +428,7 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
unsigned Align =
TM.getTargetData()->getPreferredAlignment(cast<GlobalVariable>(GV));
- std::string Name = CStringSection_->getName() + "1." + utostr(Align);
+ std::string Name = CStringSection->getName() + "1." + utostr(Align);
return getOrCreateSection(Name.c_str(), false,
SectionKind::get(SectionKind::MergeableCString));
}
@@ -451,7 +448,7 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
if (Kind.isThreadData()) return TLSDataSection;
if (Kind.isThreadBSS()) return TLSBSSSection;
- if (Kind.isBSS()) return BSSSection_;
+ if (Kind.isBSS()) return BSSSection;
if (Kind.isDataNoRel()) return DataSection;
if (Kind.isDataRelLocal()) return DataRelLocalSection;
@@ -493,7 +490,7 @@ void TargetLoweringObjectFileMachO::Initialize(MCContext &Ctx,
DataSection = getOrCreateSection("\t.data", true,
SectionKind::get(SectionKind::DataRel));
- CStringSection_ = getOrCreateSection("\t.cstring", true,
+ CStringSection = getOrCreateSection("\t.cstring", true,
SectionKind::get(SectionKind::MergeableCString));
FourByteConstantSection = getOrCreateSection("\t.literal4\n", true,
SectionKind::get(SectionKind::MergeableConst4));
@@ -554,7 +551,7 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
if (Size) {
unsigned Align = TD.getPreferredAlignment(cast<GlobalVariable>(GV));
if (Align <= 32)
- return CStringSection_;
+ return CStringSection;
}
return ReadOnlySection;
OpenPOWER on IntegriCloud