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

Julien Fischer jfischer at opturion.com
Wed Nov 11 09:17:02 AEDT 2015



On Wed, 11 Nov 2015, Zoltan Somogyi wrote:

> On Tue, 10 Nov 2015 11:24:31 +1100 (AEDT), Julien Fischer <jfischer at opturion.com> wrote:
>>> +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.
>
> At the moment, the orig inst field, which is used in the test that
> generates the above error message, is expanded out using the
> usual code in equiv_type.m. Preventing that expansion would
> require either a specialized variant of the code that expands out
> inst equivalences, or generalizing the existing code for this expansion,
> which would slow down all other inst expansions as well. Are you ok
> with that?

No. I was hoping it could be handled more locally at the point at which
the error message is generated, but slowing down inst expansions is not
a good trade off for a better error message here.

Julien.



More information about the reviews mailing list