diff options
Diffstat (limited to 'lib/Target/Mips/MipsTargetAsmInfo.cpp')
-rw-r--r-- | lib/Target/Mips/MipsTargetAsmInfo.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/Target/Mips/MipsTargetAsmInfo.cpp b/lib/Target/Mips/MipsTargetAsmInfo.cpp index 78b5c4aee0..d1fadc0e73 100644 --- a/lib/Target/Mips/MipsTargetAsmInfo.cpp +++ b/lib/Target/Mips/MipsTargetAsmInfo.cpp @@ -19,7 +19,7 @@ using namespace llvm; MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM): ELFTargetAsmInfo(TM) { - MipsTM = &TM; + Subtarget = &TM.getSubtarget<MipsSubtarget>(); AlignmentIsInBytes = false; COMMDirectiveTakesAlignment = true; @@ -34,21 +34,25 @@ MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM): 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 @@ MipsTargetAsmInfo::SectionKindForGlobal(const GlobalValue *GV) const { 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) |