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

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 26 13:38:29 PDT 2020


dblaikie added a comment.

Yep, just chiming in with a +1 for this general direction, modulo points already made that I'll reiterate:

- More specific messages on unreachable
- Unreachable only in "intended to/best of the developers knowledge that these are unreachable by any user input" (ie: if they are reached, it's because there's a bug in the compiler's source code)
- /maybe/ use "report_fatal_error" for temporary "quick (rather than having to add in error handling/propagating code paths) error for features not implemented yet but that are intended to be implemented Real Soon Now"

This is documented in the LLVM Coding Standards here: https://llvm.org/docs/CodingStandards.html#assert-liberally and the Programmers Guide here: https://llvm.org/docs/ProgrammersManual.html#programmatic-errors

If you want to ensure a good user experience for end users when the compiler violates its invariants - implement something like Clang's crash reporting wrapper (or, I think there's an in-process/single-process version of it now too). You can get a reproduction from the user, then run it with an assertions-enabled build to get specific details about the failure suitable for compiler engineers to drill-down on the failure.


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