From 97f7e4e8c9309e0806f9b8f8afcf8ce2ef63656c Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sat, 16 Jan 2021 20:23:41 -0800 Subject: [PATCH] [RISC] Replace dyn_casts that are only checked by an assert with a cast. NFC --- llvm/utils/TableGen/RISCVCompressInstEmitter.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/llvm/utils/TableGen/RISCVCompressInstEmitter.cpp b/llvm/utils/TableGen/RISCVCompressInstEmitter.cpp index 9fcb6a1..3e20a72 100644 --- a/llvm/utils/TableGen/RISCVCompressInstEmitter.cpp +++ b/llvm/utils/TableGen/RISCVCompressInstEmitter.cpp @@ -284,11 +284,7 @@ static bool verifyDagOpCount(CodeGenInstruction &Inst, DagInit *Dag, } static bool validateArgsTypes(Init *Arg1, Init *Arg2) { - DefInit *Type1 = dyn_cast(Arg1); - DefInit *Type2 = dyn_cast(Arg2); - assert(Type1 && ("Arg1 type not found\n")); - assert(Type2 && ("Arg2 type not found\n")); - return Type1->getDef() == Type2->getDef(); + return cast(Arg1)->getDef() == cast(Arg2)->getDef(); } // Creates a mapping between the operand name in the Dag (e.g. $rs1) and -- 2.7.4