Restore isa<Ty>(X) asserts inside cast<Ty>(X)
PLEASE DO NOT REVERT without careful consideration, and preferably prior discussion. cast<Ty>(X) is a "checked cast". Its entire purpose is explicitly documented (https://llvm.org/docs/ProgrammersManual.html#the-isa-cast-and-dyn-cast templates) as catching bad casts by asserting that the cast is valid. Unfortunately, in a recent rewrite of our casting infrastructure about three months back, these asserts got dropped. This is discussed in more detail on discourse in https://discourse.llvm.org/t/cast-x-is-broken-implications-and-proposal-to-address/63033. Differential Revision: https://reviews.llvm.org/D127231
Loading
Please sign in to comment