mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-14 06:37:33 +00:00
Use a switch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195857 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0de6255877
commit
b7e71e35a9
@ -281,14 +281,20 @@ static void printLeaMemReference(X86AsmPrinter &P, const MachineInstr *MI,
|
||||
// HasParenPart - True if we will print out the () part of the mem ref.
|
||||
bool HasParenPart = IndexReg.getReg() || HasBaseReg;
|
||||
|
||||
if (DispSpec.isImm()) {
|
||||
switch (DispSpec.getType()) {
|
||||
default:
|
||||
llvm_unreachable("unknown operand type!");
|
||||
case MachineOperand::MO_Immediate: {
|
||||
int DispVal = DispSpec.getImm();
|
||||
if (DispVal || !HasParenPart)
|
||||
O << DispVal;
|
||||
} else {
|
||||
assert(DispSpec.isGlobal() || DispSpec.isCPI() ||
|
||||
DispSpec.isJTI() || DispSpec.isSymbol());
|
||||
printSymbolOperand(P, MI->getOperand(Op+3), O);
|
||||
break;
|
||||
}
|
||||
case MachineOperand::MO_GlobalAddress:
|
||||
case MachineOperand::MO_ConstantPoolIndex:
|
||||
case MachineOperand::MO_JumpTableIndex:
|
||||
case MachineOperand::MO_ExternalSymbol:
|
||||
printSymbolOperand(P, MI->getOperand(Op + 3), O);
|
||||
}
|
||||
|
||||
if (Modifier && strcmp(Modifier, "H") == 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user