Simplifies logic for printing target flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128741 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Akira Hatanaka
2011-04-01 21:41:06 +00:00
parent 6c1bead22b
commit e2e436a6bc
3 changed files with 29 additions and 34 deletions

View File

@ -298,22 +298,9 @@ void MipsAsmPrinter::printOperand(const MachineInstr *MI, int opNum,
switch(MO.getTargetFlags()) {
case MipsII::MO_GPREL: O << "%gp_rel("; break;
case MipsII::MO_GOT_CALL: O << "%call16("; break;
case MipsII::MO_GOT: {
const MachineOperand &LastMO = MI->getOperand(opNum-1);
bool LastMOIsGP = LastMO.getType() == MachineOperand::MO_Register
&& LastMO.getReg() == Mips::GP;
if (MI->getOpcode() == Mips::LW || LastMOIsGP)
O << "%got(";
else
O << "%lo(";
break;
}
case MipsII::MO_ABS_HILO:
if (MI->getOpcode() == Mips::LUi)
O << "%hi(";
else
O << "%lo(";
break;
case MipsII::MO_GOT: O << "%got("; break;
case MipsII::MO_ABS_HI: O << "%hi("; break;
case MipsII::MO_ABS_LO: O << "%lo("; break;
}
switch (MO.getType()) {