X86: Use dyn_cast instead of isa+cast, NFC
llvm-svn: 243034
This commit is contained in:
parent
b33a5557f4
commit
d531322149
|
@ -2347,11 +2347,12 @@ bool X86AsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
|
|||
// instalias with an immediate operand yet.
|
||||
if (Name == "int" && Operands.size() == 2) {
|
||||
X86Operand &Op1 = static_cast<X86Operand &>(*Operands[1]);
|
||||
if (Op1.isImm() && isa<MCConstantExpr>(Op1.getImm()) &&
|
||||
cast<MCConstantExpr>(Op1.getImm())->getValue() == 3) {
|
||||
Operands.erase(Operands.begin() + 1);
|
||||
static_cast<X86Operand &>(*Operands[0]).setTokenValue("int3");
|
||||
}
|
||||
if (Op1.isImm())
|
||||
if (auto *CE = dyn_cast<MCConstantExpr>(Op1.getImm()))
|
||||
if (CE->getValue() == 3) {
|
||||
Operands.erase(Operands.begin() + 1);
|
||||
static_cast<X86Operand &>(*Operands[0]).setTokenValue("int3");
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue