summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-24 03:11:51 +0000
committerChris Lattner <sabre@nondot.org>2009-07-24 03:11:51 +0000
commit26aff56462967694e3d5aac9cef035b581a8ebf0 (patch)
treec0efe0f78f1d734d83fefce48e25311186398307 /llvm/lib
parentd9baf6aed8e63a77cfa7dbf92c7a7a02d896244a (diff)
downloadbcm5719-llvm-26aff56462967694e3d5aac9cef035b581a8ebf0.tar.gz
bcm5719-llvm-26aff56462967694e3d5aac9cef035b581a8ebf0.zip
Remove SectionKind::Small*. This was only used on mips, and is apparently
a sad mistake that is regretted. :) llvm-svn: 76935
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ELFTargetAsmInfo.cpp5
-rw-r--r--llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp50
-rw-r--r--llvm/lib/Target/Mips/MipsTargetAsmInfo.h7
-rw-r--r--llvm/lib/Target/TargetAsmInfo.cpp12
4 files changed, 2 insertions, 72 deletions
diff --git a/llvm/lib/Target/ELFTargetAsmInfo.cpp b/llvm/lib/Target/ELFTargetAsmInfo.cpp
index 8cadb530793..9e7bb4aee26 100644
--- a/llvm/lib/Target/ELFTargetAsmInfo.cpp
+++ b/llvm/lib/Target/ELFTargetAsmInfo.cpp
@@ -102,8 +102,6 @@ ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
} else {
switch (Kind) {
case SectionKind::Data:
- case SectionKind::SmallData:
- return DataSection;
case SectionKind::DataRel:
return DataRelSection;
case SectionKind::DataRelLocal:
@@ -113,11 +111,8 @@ ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
case SectionKind::DataRelROLocal:
return DataRelROLocalSection;
case SectionKind::BSS:
- case SectionKind::SmallBSS:
- // ELF targets usually have BSS sections
return getBSSSection_();
case SectionKind::ROData:
- case SectionKind::SmallROData:
return getReadOnlySection();
case SectionKind::RODataMergeStr:
return MergeableStringSection(GVar);
diff --git a/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp b/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp
index f086db02d26..f7a0acb8e54 100644
--- a/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp
+++ b/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp
@@ -20,8 +20,6 @@ using namespace llvm;
MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM):
ELFTargetAsmInfo(TM) {
- Subtarget = &TM.getSubtarget<MipsSubtarget>();
-
AlignmentIsInBytes = false;
COMMDirectiveTakesAlignment = true;
Data16bitsDirective = "\t.half\t";
@@ -34,57 +32,13 @@ MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM):
BSSSection = "\t.section\t.bss";
CStringSection = ".rodata.str";
- if (!Subtarget->hasABICall()) {
+ if (!TM.getSubtarget<MipsSubtarget>().hasABICall()) {
JumpTableDirective = "\t.word\t";
SmallDataSection = getNamedSection("\t.sdata", SectionFlags::Writeable);
SmallBSSSection = getNamedSection("\t.sbss",
SectionFlags::Writeable |
SectionFlags::BSS);
- } else
+ } else {
JumpTableDirective = "\t.gpword\t";
-
-}
-
-SectionKind::Kind MipsTargetAsmInfo::
-SectionKindForGlobal(const GlobalValue *GV) const {
- SectionKind::Kind K = ELFTargetAsmInfo::SectionKindForGlobal(GV);
-
- if (Subtarget->hasABICall())
- return K;
-
- if (K != SectionKind::Data && K != SectionKind::BSS &&
- K != SectionKind::RODataMergeConst)
- return K;
-
- if (isa<GlobalVariable>(GV)) {
- const TargetData *TD = TM.getTargetData();
- unsigned Size = TD->getTypeAllocSize(GV->getType()->getElementType());
- unsigned Threshold = Subtarget->getSSectionThreshold();
-
- if (Size > 0 && Size <= Threshold) {
- if (K == SectionKind::BSS)
- return SectionKind::SmallBSS;
- else
- return SectionKind::SmallData;
- }
}
-
- return K;
-}
-
-const Section* MipsTargetAsmInfo::
-SelectSectionForGlobal(const GlobalValue *GV) const {
- SectionKind::Kind K = SectionKindForGlobal(GV);
- const GlobalVariable *GVA = dyn_cast<GlobalVariable>(GV);
-
- if (GVA && (!GVA->isWeakForLinker()))
- switch (K) {
- case SectionKind::SmallData:
- return getSmallDataSection();
- case SectionKind::SmallBSS:
- return getSmallBSSSection();
- default: break;
- }
-
- return ELFTargetAsmInfo::SelectSectionForGlobal(GV);
}
diff --git a/llvm/lib/Target/Mips/MipsTargetAsmInfo.h b/llvm/lib/Target/Mips/MipsTargetAsmInfo.h
index 74bba10b239..f70ca527fca 100644
--- a/llvm/lib/Target/Mips/MipsTargetAsmInfo.h
+++ b/llvm/lib/Target/Mips/MipsTargetAsmInfo.h
@@ -29,13 +29,6 @@ namespace llvm {
struct MipsTargetAsmInfo : public ELFTargetAsmInfo {
explicit MipsTargetAsmInfo(const MipsTargetMachine &TM);
- /// SectionKindForGlobal - This hook allows the target to select proper
- /// section kind used for global emission.
- virtual SectionKind::Kind
- SectionKindForGlobal(const GlobalValue *GV) const;
-
- virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
-
private:
const MipsSubtarget *Subtarget;
};
diff --git a/llvm/lib/Target/TargetAsmInfo.cpp b/llvm/lib/Target/TargetAsmInfo.cpp
index 1af112c7925..c628a4f84e9 100644
--- a/llvm/lib/Target/TargetAsmInfo.cpp
+++ b/llvm/lib/Target/TargetAsmInfo.cpp
@@ -257,12 +257,6 @@ TargetAsmInfo::SectionFlagsForGlobal(const GlobalValue *GV,
case SectionKind::RODataMergeConst:
// No additional flags here
break;
- case SectionKind::SmallData:
- case SectionKind::SmallBSS:
- Flags |= SectionFlags::Writeable;
- break;
- case SectionKind::SmallROData:
- break;
default:
llvm_unreachable("Unexpected section kind!");
}
@@ -359,18 +353,12 @@ TargetAsmInfo::UniqueSectionForGlobal(const GlobalValue* GV,
return ".gnu.linkonce.d.rel.ro" + GV->getNameStr();
case SectionKind::DataRelROLocal:
return ".gnu.linkonce.d.rel.ro.local" + GV->getNameStr();
- case SectionKind::SmallData:
- return ".gnu.linkonce.s." + GV->getNameStr();
case SectionKind::BSS:
return ".gnu.linkonce.b." + GV->getNameStr();
- case SectionKind::SmallBSS:
- return ".gnu.linkonce.sb." + GV->getNameStr();
case SectionKind::ROData:
case SectionKind::RODataMergeConst:
case SectionKind::RODataMergeStr:
return ".gnu.linkonce.r." + GV->getNameStr();
- case SectionKind::SmallROData:
- return ".gnu.linkonce.s2." + GV->getNameStr();
case SectionKind::ThreadData:
return ".gnu.linkonce.td." + GV->getNameStr();
case SectionKind::ThreadBSS:
OpenPOWER on IntegriCloud