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

YingChi Long via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 11 09:47:23 PDT 2022


inclyc added a comment.

> - Prefer llvm_report_error() in any circumstance under which a code path is functionally possible to reach, but only in erroneous executions that signify a mistake on the part of the LLVM developer elsewhere in the program.
> - Prefer llvm_unreachable() in any circumstance under which a code path is believed to be functionally impossible to reach (even if technically possible to reach). The API is now self-documenting to mean "this code really should be totally unreachable".

I think `llvm_unreachable` already has the functionality reporting bugs for developer in our implementation, with +Assertions by default


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