[PATCH] D79507: [flang] Change DIE("unreachable") cases to use llvm_unreachable

Aaron Ballman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 1 11:52:59 PDT 2020


aaron.ballman added a comment.

In D79507#2066839 <https://reviews.llvm.org/D79507#2066839>, @jdoerfert wrote:

> I agree with @dblaikie, Clang and LLVM use this scheme successfully. That said, there is also `llvm/Support/ErrorHandling.h` (to handle user input errors).
>
> There was a recent discussion on when to use what mechanism, I will link here once I find it again. I want to paraphrase some comments ppl made on this in IRC:
>  "assert/llvm_unreachable if it can't happen. if it happens then either fix the code so it really doesn't happen or use report_runtime_error. if the error really can happen then use report_runtime_error"


We updated the coding standard about this: https://llvm.org/docs/CodingStandards.html#assert-liberally


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79507





More information about the llvm-commits mailing list