Get rid of a few calls through the subtarget to get the ABI

that's actually sitting on the target machine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227513 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher
2015-01-29 23:27:45 +00:00
parent 2d64c553b4
commit ca6d2a825c
3 changed files with 15 additions and 15 deletions

View File

@@ -691,6 +691,7 @@ printRegisterList(const MachineInstr *MI, int opNum, raw_ostream &O) {
void MipsAsmPrinter::EmitStartOfAsmFile(Module &M) {
bool IsABICalls = Subtarget->isABICalls();
const MipsABIInfo &ABI = static_cast<const MipsTargetMachine &>(TM).getABI();
if (IsABICalls) {
getTargetStreamer().emitDirectiveAbiCalls();
Reloc::Model RM = TM.getRelocationModel();
@@ -698,7 +699,7 @@ void MipsAsmPrinter::EmitStartOfAsmFile(Module &M) {
// Ideally it should test for properties of the ABI and not the ABI
// itself.
// For the moment, I'm only correcting enough to make MIPS-IV work.
if (RM == Reloc::Static && !Subtarget->isABI_N64())
if (RM == Reloc::Static && !ABI.IsN64())
getTargetStreamer().emitDirectiveOptionPic0();
}
@@ -715,7 +716,7 @@ void MipsAsmPrinter::EmitStartOfAsmFile(Module &M) {
// TODO: handle O64 ABI
if (Subtarget->isABI_EABI()) {
if (ABI.IsEABI()) {
if (Subtarget->isGP32bit())
OutStreamer.SwitchSection(OutContext.getELFSection(".gcc_compiled_long32",
ELF::SHT_PROGBITS, 0));
@@ -729,17 +730,15 @@ void MipsAsmPrinter::EmitStartOfAsmFile(Module &M) {
// We should always emit a '.module fp=...' but binutils 2.24 does not accept
// it. We therefore emit it when it contradicts the ABI defaults (-mfpxx or
// -mfp64) and omit it otherwise.
if (Subtarget->isABI_O32() && (Subtarget->isABI_FPXX() ||
Subtarget->isFP64bit()))
if (ABI.IsO32() && (Subtarget->isABI_FPXX() || Subtarget->isFP64bit()))
getTargetStreamer().emitDirectiveModuleFP();
// We should always emit a '.module [no]oddspreg' but binutils 2.24 does not
// accept it. We therefore emit it when it contradicts the default or an
// option has changed the default (i.e. FPXX) and omit it otherwise.
if (Subtarget->isABI_O32() && (!Subtarget->useOddSPReg() ||
Subtarget->isABI_FPXX()))
if (ABI.IsO32() && (!Subtarget->useOddSPReg() || Subtarget->isABI_FPXX()))
getTargetStreamer().emitDirectiveModuleOddSPReg(Subtarget->useOddSPReg(),
Subtarget->isABI_O32());
ABI.IsO32());
}
void MipsAsmPrinter::emitInlineAsmStart(