[PATCH] D139452: [LLVM] Use dyn_cast instead of cast for objects that require it

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 6 15:57:36 PST 2022


MaskRay added inline comments.


================
Comment at: llvm/utils/TableGen/DecoderEmitter.cpp:2111
           Init *Arg = CGI.Operands[SO.first].MIOperandInfo->getArg(SO.second);
-          if (DefInit *DI = cast<DefInit>(Arg))
+          if (DefInit *DI = dyn_cast<DefInit>(Arg))
             TypeRecord = DI->getDef();
----------------
See the reverted ba59ec2843f99f19d55d7cd9f9ac536fb038fdab: this change seems wrong.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139452/new/

https://reviews.llvm.org/D139452



More information about the llvm-commits mailing list