[PATCH] D135551: [clang] replace `assert(0)` with `llvm_unreachable` NFC

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 11 09:06:10 PDT 2022


dblaikie added a comment.

>> Generally LLVM's pretty hard to fathom in a non-asserts build anyway, right? (that's the first thing any of us do is reproduce with an assertions build that may fail miles away from where a crash occurred because an invariant was violated much earlier) - that `cast` won't crash/will continue on happily in a non-asserts build seems like a much larger hole to debuggability of a non-asserts build than any unreachable?
>
> This might be true -- personally, I tend to only use debug builds with MSVC because RelWithDebInfo isn't sufficient for my daily needs. However, I've definitely heard of folks who use RelWithDebInfo for their daily work (RelWithDebInfo + Asserts specifically, IIRC) because of the improved build times and runtime performance; we should be sure we're not disrupting that workflow too much.

Changing `assert(0)` to `llvm_unreachable` does not change the behavior of any +Asserts build. The behavior of unreachable is the same as assert(0) in a +Asserts build.

Is this observation enough to undeadlock this conversation?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135551



More information about the cfe-commits mailing list