Quality of errors in DMD

David Nadlinger via Digitalmars-d digitalmars-d at puremagic.com
Fri Sep 2 15:53:39 PDT 2016


On Friday, 2 September 2016 at 22:12:20 UTC, Walter Bright wrote:
> Compiling with -v will usually show how far the compiler got.

It's curious that this topic should come up now – just a couple 
of days ago, I thought about adding better user reporting for LDC 
ICEs.

What I was planning to do is to keep a global stack of locations 
(and symbols where applicable, to be able to print the name) that 
is updated as the AST is traversed during semantic and glue 
layer. This should be very cheap to do, especially since the 
information does not need to be perfect.

You can then install a custom assert/segfault handler to print 
that information to aid users in reducing a test case or working 
around the problem, even for hard crashes or ICEs. The location 
information needs to be just close enough that the user knows 
where to start looking if the error appears after a compiler 
upgrade or when writing template-heavy code.

  — David


More information about the Digitalmars-d mailing list