[m-dev.] interface_files branch

Julien Fischer jfischer at opturion.com
Wed Jun 26 00:18:57 AEST 2019


On Tue, 25 Jun 2019, Zoltan Somogyi wrote:

> On Tue, 25 Jun 2019 19:01:40 +1000 (AEST), Julien Fischer <jfischer at opturion.com> wrote:
>> I have tried it out and have not encountered any problems.
>
> Thank you, Julien and Peter. Then the attached diff, which includes all the changes
> made on the interface_files branch, is ready for review, by anyone.


> Put only necessary info into .int3 files.
> 
> This pulls the changes from the interface_files git branch onto master.
> 
> compiler/comp_unit_interface.m:
>     Put abstract forms of insts and modes into .int3 files.
>
>     Strip superclasses from class decls in .int3s.
>
>     Delete redundant fields from a structure.
>
>     Delete XXXs based on a misunderstanding.
>
>     Delete an obsolete comment.
> 
> compiler/get_dependencies.m:
>     Fix a comment.
> 
> compiler/modules.m:
>     Add each section's implicit imports to its OWN section when reading
>     interface files (.int and .int2 files). (Until now, we added
>     all implicit dependencies to the interface section, including those
>     that were required only by the implementation section.)
>
>     Don't duplicate abstract instance decls from int to imp.
>
>     Delete XXXs based on a misunderstanding.
> 
> diff --git a/compiler/comp_unit_interface.m b/compiler/comp_unit_interface.m
> index 23aa33ee0..0aa097d75 100644
> --- a/compiler/comp_unit_interface.m
> +++ b/compiler/comp_unit_interface.m
> @@ -281,17 +281,12 @@ get_short_interface_int3_from_items([Item | Items], !IntItems, !IntTypeDefns,
>          !:IntItems = cord.snoc(!.IntItems, AbstractOrForeignItem)
>      ;
>          Item = item_typeclass(ItemTypeClassInfo),
> -        AbstractItemTypeClassInfo = ItemTypeClassInfo ^ tc_class_methods
> -            := class_interface_abstract,
> +        ItemTypeClassInfo = item_typeclass_info(ClassName, ParamsTVars,
> +            _Constraints, _FunDeps, _Methods, TVarSet, Context, SeqNum),
> +        AbstractItemTypeClassInfo = item_typeclass_info(ClassName, ParamsTVars,
> +            [], [], class_interface_abstract, TVarSet, Context, SeqNum),
>          AbstractItem = item_typeclass(AbstractItemTypeClassInfo),
> -        !:IntItems = cord.snoc(!.IntItems, AbstractItem),
> -        % We may need the imported modules to module qualify the names
> -        % of the type constructors in the superclass constraints, if any.
> -        % XXX TYPE_REPN Then we should set do_need_avails only if there
> -        % *are* some superclass constraints.
> -        % XXX TYPE_REPN Also, why do we need to put the superclass
> -        % constraints into .int3 files?
> -        !:NeedAvails = do_need_avails
> +        !:IntItems = cord.snoc(!.IntItems, AbstractItem)

You could use the predicate version of cord.snoc here and in the rest of the diff.

Looks fine otherwise.

Julien.


More information about the developers mailing list