mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-10 18:26:02 +00:00
X86: Use dyn_cast instead of isa+cast, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243034 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2347,8 +2347,9 @@ bool X86AsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
|
|||||||
// instalias with an immediate operand yet.
|
// instalias with an immediate operand yet.
|
||||||
if (Name == "int" && Operands.size() == 2) {
|
if (Name == "int" && Operands.size() == 2) {
|
||||||
X86Operand &Op1 = static_cast<X86Operand &>(*Operands[1]);
|
X86Operand &Op1 = static_cast<X86Operand &>(*Operands[1]);
|
||||||
if (Op1.isImm() && isa<MCConstantExpr>(Op1.getImm()) &&
|
if (Op1.isImm())
|
||||||
cast<MCConstantExpr>(Op1.getImm())->getValue() == 3) {
|
if (auto *CE = dyn_cast<MCConstantExpr>(Op1.getImm()))
|
||||||
|
if (CE->getValue() == 3) {
|
||||||
Operands.erase(Operands.begin() + 1);
|
Operands.erase(Operands.begin() + 1);
|
||||||
static_cast<X86Operand &>(*Operands[0]).setTokenValue("int3");
|
static_cast<X86Operand &>(*Operands[0]).setTokenValue("int3");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user