[llvm] r243034 - X86: Use dyn_cast instead of isa+cast, NFC
Duncan P. N. Exon Smith
dexonsmith at apple.com
Thu Jul 23 12:27:08 PDT 2015
Author: dexonsmith
Date: Thu Jul 23 14:27:07 2015
New Revision: 243034
URL: http://llvm.org/viewvc/llvm-project?rev=243034&view=rev
Log:
X86: Use dyn_cast instead of isa+cast, NFC
Modified:
llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=243034&r1=243033&r2=243034&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Thu Jul 23 14:27:07 2015
@@ -2347,11 +2347,12 @@ bool X86AsmParser::ParseInstruction(Pars
// 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;
More information about the llvm-commits
mailing list