[m-dev.] for review: make type and typeclass info varmaps valid
David Glen JEFFERY
dgj at cs.mu.OZ.AU
Mon Jul 26 18:12:36 AEST 1999
On 21-Jul-1999, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 21-Jul-1999, David Glen JEFFERY <dgj at cs.mu.OZ.AU> wrote:
> > Estimated hours taken: 1.5
> >
> > compiler/polymorphism.m:
> > Make the type and type class info varmaps valid for imported
> > procedures.
>
> That looks fine, but it would also be a good idea to make the varset
> valid too.
Estimated hours taken: 1.5
compiler/polymorphism.m:
Make the type and type class info varmaps valid for imported
procedures.
Index: polymorphism.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/polymorphism.m,v
retrieving revision 1.167
diff -u -t -r1.167 polymorphism.m
--- polymorphism.m 1999/07/13 08:53:20 1.167
+++ polymorphism.m 1999/07/26 08:02:27
@@ -716,22 +716,33 @@
)
->
%
- % We need to set the headvars in the proc_info here, because
+ % We need to set these fields in the proc_info here, because
% some parts of the compiler (e.g. unused_args.m) depend on the
- % headvars field being valid even for imported procedures.
+ % these fields being valid even for imported procedures.
%
clauses_info_headvars(ClausesInfo, HeadVars),
- proc_info_set_headvars(ProcInfo0, HeadVars, ProcInfo1)
+ clauses_info_typeclass_info_varmap(ClausesInfo,
+ TypeClassInfoVarMap),
+ clauses_info_type_info_varmap(ClausesInfo,
+ TypeInfoVarMap),
+ clauses_info_varset(ClausesInfo,
+ VarSet),
+ proc_info_set_headvars(ProcInfo0, HeadVars, ProcInfo1),
+ proc_info_set_typeclass_info_varmap(ProcInfo1,
+ TypeClassInfoVarMap, ProcInfo2),
+ proc_info_set_typeinfo_varmap(ProcInfo2,
+ TypeInfoVarMap, ProcInfo3),
+ proc_info_set_varset(ProcInfo3, VarSet, ProcInfo4)
;
- copy_clauses_to_proc(ProcId, ClausesInfo, ProcInfo0, ProcInfo1)
+ copy_clauses_to_proc(ProcId, ClausesInfo, ProcInfo0, ProcInfo4)
),
%
% add the ExtraArgModes to the proc_info argmodes
%
- proc_info_argmodes(ProcInfo1, ArgModes1),
+ proc_info_argmodes(ProcInfo4, ArgModes1),
list__append(ExtraArgModes, ArgModes1, ArgModes),
- proc_info_set_argmodes(ProcInfo1, ArgModes, ProcInfo).
+ proc_info_set_argmodes(ProcInfo4, ArgModes, ProcInfo).
% XXX the following code ought to be rewritten to handle
% existential/universal type_infos and type_class_infos
dgj
--
David Jeffery (dgj at cs.mu.oz.au) | If your thesis is utterly vacuous
PhD student, | Use first-order predicate calculus.
Dept. of Comp. Sci. & Soft. Eng.| With sufficient formality
The University of Melbourne | The sheerist banality
Australia | Will be hailed by the critics: "Miraculous!"
| -- Anon.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list