[m-rev.] for review: replace item_id_sets

Julien Fischer jfischer at opturion.com
Fri Aug 27 21:44:04 AEST 2021


On Fri, 27 Aug 2021, Zoltan Somogyi wrote:

> Replace item_id_set with several specialized types.

...


> diff --git a/compiler/recompilation.version.m b/compiler/recompilation.version.m
> index 4708e4a97..87fb318bc 100644
> --- a/compiler/recompilation.version.m
> +++ b/compiler/recompilation.version.ms

...

>      % Pragmas can apply to typeclass methods.
> -    map.map_values_only(distribute_pragma_items_class_items(MaybePredOrFunc,
> -        SymName, Arity, Item, Section),
> -        extract_ids(!.GatheredItems, typeclass_item), GatheredTypeClasses),
> -    update_ids(typeclass_item, GatheredTypeClasses, !GatheredItems).
> +    % XXX I (zs) do not see why a decl_pragma *outside* a typeclass
> +    % declaration should be able to apply to a class method that is declared
> +    % *inside* the typeclass declaration. We should require that any
> +    % decl pragma that is intended to apply to a class method
> +    % should be declared next to it *inside the typeclass declaration itself*.

At the moment I don't think we allow anything inside typeclass declarations
except pred, mode and func declarations.

> +    map.map_values_only(
> +        distribute_pragma_items_class_items(MaybePredOrFunc,
> +            SymName, Arity, Item, Section),
> +        !TypeClassMap).
>
>  :- pred distribute_pragma_items_class_items(maybe(pred_or_func)::in,
>      sym_name::in, arity::in, item::in, module_section::in,

...

> diff --git a/tests/recompilation/two_module_debug b/tests/recompilation/two_module_debug
> index e69de29bb..e2f408690 100755
> --- a/tests/recompilation/two_module_debug
> +++ b/tests/recompilation/two_module_debug
> @@ -0,0 +1,71 @@
> +#!/bin/sh
> +# vim: ts=4 sw=4 expandtab ft=sh
> +#
> +# A version two_module_test that should be more useful for debugging,

    A version *of* two_module_test

> +# because instead of hiding the action behind shell functions, it exposes
> +# the details of each step. This allows a Mercury developer to (temporarily)
> +# modify this script to observe not just the final result of a call to a shell
> +# function, but also its intermediate results, e.g. by copying files

The rest looks fine.

Julien.


More information about the reviews mailing list