[m-rev.] for post-commit review: a start on getting type repn info from .int files

Zoltan Somogyi zoltan.somogyi at runbox.com
Wed Jul 28 20:11:44 AEST 2021


2021-07-26 12:10 GMT+10:00 "Julien Fischer" <jfischer at opturion.com>:
> With regard to the way the compiler prints out error messages during
> dependency generation: I assume that its current behaviour is just
> for historical reasons?  (i.e. collecting and printing them all at
> once would be the more desirable behaviour anyway)

Yes. Once, the compiler used io.write_string calls to print out
each error message as soon as it found an error, and the code
to do so was always clunky: print the context prefix, print some stuff
that you *think* is likely to fit in 80 chars, and then repeat until
the error message is all printed. This resulted in amateur looking
error output, and in lots of places that forgot to update the
error counter appropriately. I wrote error_util.m to fix those
problems, and gradually converted almost all error messages
to use them; today, it is mostly just the error messages about
"cant open file F" that we still print without using error_util.m.

Even with this change, all errors were still output as we found them.
This meant that you still got output that complained about
errors on line 40, then 80, then 65, then 32, all jumbled up.
I then tackled one compiler pass a time, modifying it not to print
each error_spec as soon as it is generated, but gather them up,
and return them to mercury_compile.m (before it was split up)
to be sorted and printed at once. But I left out the parts of the
compiler that I did not know well, and/or which did not
forcibly arrest my attention by generating error messages
frequently enough. Dependency generation falls into both
of those categories.

I will change it to the same gather up spec/print all at once
model sometime in the next week or two.

Zoltan.


More information about the reviews mailing list