[m-rev.] for review: make module_cmds.m's callers specify explicit streams

Julien Fischer jfischer at opturion.com
Mon May 17 19:37:54 AEST 2021


On Mon, 17 May 2021, Zoltan Somogyi wrote:

> Specify streams explicitly in more modules.
> 
> compiler/module_cmds.m:
>     Require all callers to specify output streams explicitly.
> 
> compiler/compile_target_code.m:
>     Require callers to specify output streams explicitly in most cases.
>
>     In the remaining cases, add "XXX STREAM" comments to request that
>     the explicit streams be passed later.
>
>     Add XXXs where preserving old behavior results in wrong-looking code.

...

> diff --git a/compiler/compile_target_code.m b/compiler/compile_target_code.m
> index 7c9881969..6a5d4059d 100644
> --- a/compiler/compile_target_code.m
> +++ b/compiler/compile_target_code.m
> @@ -40,54 +40,65 @@
>      --->    pic
>      ;       non_pic.
> 
> -    % compile_c_file(Globals, ErrorStream, PIC, ModuleName, Succeeded, !IO)
> +    % compile_c_file(Globals, ProgressStream, ErrorStream, PIC, ModuleName,
> +    %   Succeeded, !IO)
>      %
> -:- pred compile_c_file(globals::in, io.output_stream::in, pic::in,
> +:- pred compile_c_file(globals::in,
> +    io.text_output_stream::in, io.text_output_stream::in, pic::in,
>      module_name::in, bool::out, io::di, io::uo) is det.
> 
> -    % do_compile_c_file(Globals, ErrorStream, PIC, CFile, ObjFile, Succeeded,
> -    %   !IO)
> +    % do_compile_c_file(Globals, ProgressStream, ErrorStream,
> +    %   PIC, CFile, ObjFile, Succeeded, !IO)
>      %
> -:- pred do_compile_c_file(globals::in, io.output_stream::in, pic::in,
> +:- pred do_compile_c_file(globals::in,
> +    io.text_output_stream::in, io.text_output_stream::in, pic::in,
>      string::in, string::in, bool::out, io::di, io::uo) is det.
> 
> -    % compile_java_files(Globals, ErrorStream, JavaFiles, Succeeded, !IO)
> +    % compile_java_files(Globals, ProgressStream, ErrorStream,
> +    %   HeadJavaFile, TailJavaFiles, Succeeded, !IO)
>      %
> -:- pred compile_java_files(globals::in, io.output_stream::in, list(string)::in,
> -    bool::out, io::di, io::uo) is det.
> +:- pred compile_java_files(globals::in,
> +    io.text_output_stream::in, io.text_output_stream::in,
> +    string::in, list(string)::in, bool::out, io::di, io::uo) is det.

Splitting the list of Java files passed to this predicate isn't mentioned in the
log message.

The rest looks fine.

Julien.


More information about the reviews mailing list