Give guidance on report_fatal_error in CodingStandards.rst and ProgrammersManual.rst
authorAlex Bradbury <asb@lowrisc.org>
Fri, 18 Aug 2017 05:29:21 +0000 (05:29 +0000)
committerAlex Bradbury <asb@lowrisc.org>
Fri, 18 Aug 2017 05:29:21 +0000 (05:29 +0000)
commit7182440fbd11ce1c3602bafd8aaba2da765dc94b
tree60c4df26200dea340b126bd2d29cf8883073daee
parent7eaaa0f0f2e88e6dcf6b1e92629ae0106a1fbce0
Give guidance on report_fatal_error in CodingStandards.rst and ProgrammersManual.rst

The current ProgrammersManual.rst document has a lot of well-written
documentation on error handling thanks to @lhames. It suggests errors can be
split cleanly into "programmatic" and "recoverable" errors. However, the
reality in current LLVM seems to be there are a number of cases where a
non-programmatic error is not easily recoverable. Therefore, add a note to
indicate the existence of report_fatal_error for these cases. I've also added
a reminder to CodingStandards.rst in the section on assertions, to indicate
that llvm_unreachable and assertions should not be relied upon to report
errors triggered by user input.

The ProgrammersManual is also silent on the use of LLVMContext::diagnose,
which is used in BPF+WebAssembly+AMDGPU to report some errors during
instruction selection. I don't address that in this patch, as it's not quite
clear how to fit in to the current error handling story

Differential Revision: https://reviews.llvm.org/D36826

llvm-svn: 311146
llvm/docs/CodingStandards.rst
llvm/docs/ProgrammersManual.rst