mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +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:
@@ -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.
|
// HasParenPart - True if we will print out the () part of the mem ref.
|
||||||
bool HasParenPart = IndexReg.getReg() || HasBaseReg;
|
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();
|
int DispVal = DispSpec.getImm();
|
||||||
if (DispVal || !HasParenPart)
|
if (DispVal || !HasParenPart)
|
||||||
O << DispVal;
|
O << DispVal;
|
||||||
} else {
|
break;
|
||||||
assert(DispSpec.isGlobal() || DispSpec.isCPI() ||
|
}
|
||||||
DispSpec.isJTI() || DispSpec.isSymbol());
|
case MachineOperand::MO_GlobalAddress:
|
||||||
printSymbolOperand(P, MI->getOperand(Op+3), O);
|
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)
|
if (Modifier && strcmp(Modifier, "H") == 0)
|
||||||
|
Reference in New Issue
Block a user