mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-02 07:32:52 +00:00
Convert two if sequences to switches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195859 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b7e71e35a9
commit
4635dbb8bc
@ -426,31 +426,42 @@ bool X86AsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
|||||||
// See if this is a generic print operand
|
// See if this is a generic print operand
|
||||||
return AsmPrinter::PrintAsmOperand(MI, OpNo, AsmVariant, ExtraCode, O);
|
return AsmPrinter::PrintAsmOperand(MI, OpNo, AsmVariant, ExtraCode, O);
|
||||||
case 'a': // This is an address. Currently only 'i' and 'r' are expected.
|
case 'a': // This is an address. Currently only 'i' and 'r' are expected.
|
||||||
if (MO.isImm()) {
|
switch (MO.getType()) {
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
|
case MachineOperand::MO_Immediate:
|
||||||
O << MO.getImm();
|
O << MO.getImm();
|
||||||
return false;
|
return false;
|
||||||
}
|
case MachineOperand::MO_GlobalAddress:
|
||||||
if (MO.isGlobal() || MO.isCPI() || MO.isJTI() || MO.isSymbol()) {
|
case MachineOperand::MO_ConstantPoolIndex:
|
||||||
|
case MachineOperand::MO_JumpTableIndex:
|
||||||
|
case MachineOperand::MO_ExternalSymbol:
|
||||||
printSymbolOperand(*this, MO, O);
|
printSymbolOperand(*this, MO, O);
|
||||||
if (Subtarget->isPICStyleRIPRel())
|
if (Subtarget->isPICStyleRIPRel())
|
||||||
O << "(%rip)";
|
O << "(%rip)";
|
||||||
return false;
|
return false;
|
||||||
}
|
case MachineOperand::MO_Register:
|
||||||
if (MO.isReg()) {
|
|
||||||
O << '(';
|
O << '(';
|
||||||
printOperand(*this, MI, OpNo, O);
|
printOperand(*this, MI, OpNo, O);
|
||||||
O << ')';
|
O << ')';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
|
|
||||||
case 'c': // Don't print "$" before a global var name or constant.
|
case 'c': // Don't print "$" before a global var name or constant.
|
||||||
if (MO.isImm())
|
switch (MO.getType()) {
|
||||||
O << MO.getImm();
|
default:
|
||||||
else if (MO.isGlobal() || MO.isCPI() || MO.isJTI() || MO.isSymbol())
|
|
||||||
printSymbolOperand(*this, MO, O);
|
|
||||||
else
|
|
||||||
printOperand(*this, MI, OpNo, O);
|
printOperand(*this, MI, OpNo, O);
|
||||||
|
break;
|
||||||
|
case MachineOperand::MO_Immediate:
|
||||||
|
O << MO.getImm();
|
||||||
|
break;
|
||||||
|
case MachineOperand::MO_GlobalAddress:
|
||||||
|
case MachineOperand::MO_ConstantPoolIndex:
|
||||||
|
case MachineOperand::MO_JumpTableIndex:
|
||||||
|
case MachineOperand::MO_ExternalSymbol:
|
||||||
|
printSymbolOperand(*this, MO, O);
|
||||||
|
break;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
case 'A': // Print '*' before a register (it must be a register)
|
case 'A': // Print '*' before a register (it must be a register)
|
||||||
|
Loading…
Reference in New Issue
Block a user