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

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 1 11:18:41 PDT 2020


jdoerfert added subscribers: lebedev.ri, aaron.ballman, jdoerfert.
jdoerfert added a comment.

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"


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