[m-rev.] for review: start using the new code in file_names.m

Julien Fischer jfischer at opturion.com
Mon Jun 19 22:52:30 AEST 2023



On Mon, 19 Jun 2023, Zoltan Somogyi wrote:

>>> At this point, I would propose that we disable sanity checks in the
>>> specific case where the newext asks for the lookup of the value
>>> of an option. For those, what should matter is whether all parts of the
>>> system agree on the directory where to put the file, not whether this
>>> agrees with the old system, because I think the old system needs
>>> some rationalization anyway.
>>
>> Clearly ;-)  I have no objection to disabling the sanity checks in
>> the specific case above.
>
> The attached diff, which includes the one you sent, does this.

There's a couple of minor errors there.

> diff --git a/compiler/file_names.m b/compiler/file_names.m
> index dc565084c..d5ae8a7ac 100644
> --- a/compiler/file_names.m
> +++ b/compiler/file_names.m
> @@ -641,6 +641,88 @@ module_name_to_source_file_name(ModuleName, SourceFileName, !IO) :-
>
>  %---------------------------------------------------------------------------%
> 
> +:- pred newext_uses_option(newext::in) is semidet.
> +
> +newext_uses_option(Ext) :-
> +    require_complete_switch [NewExt]

s/NewExt/Ext/ there.

> +    (
> +        ( Ext = newext_src
> +        ; Ext = newext_analysis(_)
> +        ; Ext = newext_bytecode(_)
> +        ; Ext = newext_exec(_)
> +        ; Ext = newext_int(_)
> +        ; Ext = newext_lib(_)
> +        ; Ext = newext_mh(_)
> +        ; Ext = newext_mih(_)
> +        ; Ext = newext_misc_gs(_)
> +        ; Ext = newext_misc_ngs(_)
> +        ; Ext = newext_mmake_fragment(_)
> +        ; Ext = newext_mmake_target(_)
> +        ; Ext = newext_opt(_)
> +        ; Ext = newext_other(_)
> +        ; Ext = newext_target_c_cs(_)
> +        ; Ext = newext_target_date(_)
> +        ; Ext = newext_target_init_c(_)
> +        ; Ext = newext_target_java(_)
> +        ; Ext = newext_user(_)
> +        ; Ext = newext_user_ngs(_)
> +        ),
> +        fail
> +    ;

...

> +        Ext = newext_lib_gs(ExtLibGs),
> +        (
> +            ( ExtLibGs = ext_lib_gs_dollar_a
> +            ; ExtLibGs = ext_lib_gs_archive
> +            ; ExtLibGs = ext_lib_gs_dll
> +            ; ExtLibGs = ext_lib_gs_init
> +            ; ExtLibGs = ext_lib_gs_jar
> +            ),
> +            fail
> +        ;
> +            ( ExtLibGs = ext_lib_gs_lib_opt
> +            ; ExtLibGs = ext_lib_gs_sh_lib_opt.

There's a stray period there.

I've tried the fixed verison of the above on the samples on my Windows
machine and it seems fine.

Julien.


More information about the reviews mailing list