summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2008-07-23 16:01:50 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2008-07-23 16:01:50 +0000
commitfdb4cec2fe1e990f81cf9b6bd22f162346d3124b (patch)
tree6477d045c1e8df15a1e985118c93c8ccbf33d0dd /llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp
parent6bbb53dac82cc7aeff863f31ca790bd15d8eee91 (diff)
downloadbcm5719-llvm-fdb4cec2fe1e990f81cf9b6bd22f162346d3124b.tar.gz
bcm5719-llvm-fdb4cec2fe1e990f81cf9b6bd22f162346d3124b.zip
Minor fixes.
Added ConstantPool support. llvm-svn: 53951
Diffstat (limited to 'llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp')
-rw-r--r--llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp b/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp
index 78b5c4aee0e..d1fadc0e735 100644
--- a/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp
+++ b/llvm/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)
OpenPOWER on IntegriCloud