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

Alf via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 6 15:54:11 PST 2022


gAlfonso-bit added a comment.

In D139452#3975588 <https://reviews.llvm.org/D139452#3975588>, @MaskRay wrote:

> I agree that the call site uses are somewhat problematic, but `cast` has stronger guarantee. Do you have a test case to trigger a code path that `dyn_cast` returns nullptr? If not, the `if` statement should just be replaced with unconditional `cast`.

Done!


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

https://reviews.llvm.org/D139452



More information about the llvm-commits mailing list