[m-rev.] for post-commit review: give "current dir" extensions their own categories

Julien Fischer jfischer at opturion.com
Tue Jun 6 11:39:21 AEST 2023


On Mon, 5 Jun 2023, Zoltan Somogyi wrote:

> Give "current dir" suffixes their own newext category.

...

> 
> diff --git a/compiler/file_names.m b/compiler/file_names.m
> index e6e71e719..12754078c 100644
> --- a/compiler/file_names.m
> +++ b/compiler/file_names.m
> @@ -950,11 +950,63 @@ make_include_file_path(ModuleSourceFileName, OrigFileName, Path) :-
>  %---------------------------------------------------------------------------%
>  %---------------------------------------------------------------------------%
> 
> -:- type new_ext == ext.
> +    % NOTE All of the string arguments below, with the possible exception
> +    % of the argument of newext_make, should be replaced by category-specific
> +    % enums.
> +:- type newext
> +    --->    newext_src
> +            % The extension string is ".m".
> 
> -:- func make_new_extension(string) = new_ext.
> +    ;       newext_executable(string)
> +    ;       newext_library(string)
> +            % Executables and library files, which are always put into
> +            % the current directory.
> 
> -make_new_extension(Str) = ext_other(other_ext(Str)).
> +    ;       newext_executable_gs(string)
> +    ;       newext_library_gs(string)
> +            % Executables and library files, which are
> +            %
> +            % - put into the current directory with --no-use-grade-subdirs,
> +            % - put into a grade subdir with --use-grade-subdirs.
> +            %
> +            % Note that the documention of --use-grade-subdirs says
> +            % "Executables and libraries will be symlinked or copied into the
> +            % current directory", but if this is actually done, it is done
> +            % outside file_names.m.
> +
> +    ;       newext_mh(string)
> +            % Machine-dependent header files for generated C code.
> +            % The extension string is ".mh".

What do .mh files contain that is machine dependent (other than the
comment at their head containing FullArchName)?

> +
> +    ;       newext_user(string)
> +            % Compiler-generated files that are intended to be read
> +            % by the programmer, such as .err files.
> +
> +    ;       newext_make(string)
> +            % These suffixes are used not to create filenames, but to
> +            % create mmake target names. So do refer to real files,

Missing word there.

> +            % but they can (and some do) refer to these using exnetsion


s/exnetsion/extension/

> +            % strings that can contain references to make variables.
> +            % Some of the other generated make targets are phony targets,
> +            % meaning that they never correspond to real files at all.
> +
> +    ;       newext_other(other_newext).
> +            % The general case. The extension string must not be covered
> +            % by any of the other cases above.
> +


Julien.


More information about the reviews mailing list