Minor fixes.
Added ConstantPool support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53951 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/Mips/MipsTargetAsmInfo.cpp b/lib/Target/Mips/MipsTargetAsmInfo.cpp
index 78b5c4a..d1fadc0 100644
--- a/lib/Target/Mips/MipsTargetAsmInfo.cpp
+++ b/lib/Target/Mips/MipsTargetAsmInfo.cpp
@@ -19,7 +19,7 @@
MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM):
ELFTargetAsmInfo(TM) {
- MipsTM = &TM;
+ Subtarget = &TM.getSubtarget<MipsSubtarget>();
AlignmentIsInBytes = false;
COMMDirectiveTakesAlignment = true;
@@ -34,21 +34,25 @@
BSSSection = "\t.section\t.bss";
LCOMMDirective = "\t.lcomm\t";
CStringSection = ".rodata.str";
+ FourByteConstantSection = "\t.section\t.rodata.cst4,\"aM\",@progbits,4";
- if (!TM.getSubtarget<MipsSubtarget>().hasABICall())
+ if (!Subtarget->hasABICall()) {
JumpTableDirective = "\t.word\t";
- else
+ SmallDataSection = getNamedSection("\t.sdata", SectionFlags::Writeable);
+ SmallBSSSection = getNamedSection("\t.sbss", SectionFlags::Writeable |
+ SectionFlags::BSS);
+ } else
JumpTableDirective = "\t.gpword\t";
-
- SmallDataSection = getNamedSection("\t.sdata", SectionFlags::Writeable);
- SmallBSSSection = getNamedSection("\t.sbss",
- SectionFlags::Writeable | SectionFlags::BSS);
+
}
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;
@@ -56,8 +60,7 @@
if (isa<GlobalVariable>(GV)) {
const TargetData *TD = ETM->getTargetData();
unsigned Size = TD->getABITypeSize(GV->getType()->getElementType());
- unsigned Threshold =
- MipsTM->getSubtarget<MipsSubtarget>().getSSectionThreshold();
+ unsigned Threshold = Subtarget->getSSectionThreshold();
if (Size > 0 && Size <= Threshold) {
if (K == SectionKind::BSS)