Remove SectionKind::Small*. This was only used on mips, and is apparently
a sad mistake that is regretted. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76935 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/Mips/MipsTargetAsmInfo.cpp b/lib/Target/Mips/MipsTargetAsmInfo.cpp
index f086db0..f7a0acb 100644
--- a/lib/Target/Mips/MipsTargetAsmInfo.cpp
+++ b/lib/Target/Mips/MipsTargetAsmInfo.cpp
@@ -20,8 +20,6 @@
MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM):
ELFTargetAsmInfo(TM) {
- Subtarget = &TM.getSubtarget<MipsSubtarget>();
-
AlignmentIsInBytes = false;
COMMDirectiveTakesAlignment = true;
Data16bitsDirective = "\t.half\t";
@@ -34,57 +32,13 @@
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);
}