[m-rev.] for post-commit review: improve mutable inst checks

Julien Fischer jfischer at opturion.com
Tue Nov 10 11:24:31 AEDT 2015


Hi Zoltan,

On Mon, 9 Nov 2015, Zoltan Somogyi wrote:

> Improve error messages for bad insts in mutables.

...

> 
> diff --git a/tests/invalid/uniq_mutable.err_exp b/tests/invalid/uniq_mutable.err_exp
> index f720284..5034de2 100644
> --- a/tests/invalid/uniq_mutable.err_exp
> +++ b/tests/invalid/uniq_mutable.err_exp
> @@ -1,10 +1,13 @@

...

> +uniq_mutable.m:024: Error: in the expansion of the named inst `builtin.dead'/0:
> +uniq_mutable.m:024:   the inst `clobbered' is not allowed in `:- mutable'
> +uniq_mutable.m:024:   declarations.
> +uniq_mutable.m:025: Error: in the expansion of the named inst
> +uniq_mutable.m:025:   `builtin.mostly_dead'/0:
> +uniq_mutable.m:025:   the inst `mostly_clobbered' is not allowed in
> +uniq_mutable.m:025:   `:- mutable' declarations.

I wouldn't expand named insts that are defined in the builtin module,
particularly for the case of 'dead' and 'mostly_dead' which are what the
reference manual actually refers to when it defines the restrictions on mutable
insts.

     The inst varinst is not allowed to contain any inst variables. It is also not
     allowed to be equivalent to, or contain components that are equivalent to, the
     builtin insts free, unique, mostly_unique, dead or mostly_dead.

For clarity the reference manual should be changed so the last bit reads:

     builtin insts free, unique, mostly_unique, dead (clobbered) or
     mostly_dead (mostly_clobbered).

The rest looks fine.

Julien.



More information about the reviews mailing list