[m-rev.] for review: Don't use exceptions internally for foreign include file errors.

Julien Fischer jfischer at opturion.com
Fri Aug 17 20:13:59 AEST 2018


Hi Peter,

On Fri, 17 Aug 2018, Peter Wang wrote:

> Use normal return values to signal errors internally if a file
> referenced by a `include_file' in a foreign_decl or foreign_code

s/a/an/

> declaration is missing or there is some error reading from it,
> instead of throwing and catching an exception. This allows a compiler
> built in a deep profiling grade to continue without aborting.
>
> compiler/file_util.m
>    Make the closure argument to output_to_file return a list of error
>    strings, and make output_to_file return a boolean indicating if
>    there were any errors.
>
>    Delete output_to_file_return_result as it was only used to implement
>    output_to_file.
>
>    Make write_include_file_contents, write_include_file_contents_cur_stream

Replace the comma with "and".

>    return an error instead of throwing an exception if the include file
>    could not be opened or copied to the output stream.
>
>    Delete the include_file_error type. Don't throw or catch exceptions
>    of that type.

The diff looks fine.

Julien.


More information about the reviews mailing list