[llvm-dev] Need help with code generation

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 22 07:31:20 PDT 2016


On Mon, Mar 21, 2016 at 02:32:10PM -0700, David Blaikie via llvm-dev wrote:
> So far as I know, any place where LLVM asserts on user input is a bug -
> maybe not a high priority bug in some cases, maybe a difficult bug in some
> cases, but a bug.
> 
> report_fatal_error is a bit of a wart, to be sure (but that's more along
> the lines of the previous LLD design thread - API level error handling V
> exit(1) from deep in the library*)

There is a huge difference in the user experience between on the one
hand an assert or explicit error print + exit and on the other hand, a
segmention fault. The former at the very least clearly conveys the
intention of "this should not have happend and here are the conditions
that went wrong". The latter requires at least a debugger to be even
able to create a useful bug report in most instances. An assert at the
very least is a controlled exit.

Joerg


More information about the llvm-dev mailing list