[m-dev.] for review: make type and typeclass info varmaps valid

David Glen JEFFERY dgj at cs.mu.OZ.AU
Wed Jul 21 15:50:16 AEST 1999


Hi Fergus,

Could you please review this?

--------------------------------------------------------------------------

Estimated hours taken: 1.5

compiler/polymorphism.m:
	Make the type and type class info varmaps valid for imported 
	procedures.

--------------------------------------------------------------------------

cvs diff: Diffing .
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/21 05:40:34
@@ -716,22 +716,30 @@
                 )
         ->
                 % 
-                % 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),
+                proc_info_set_headvars(ProcInfo0, HeadVars, ProcInfo1),
+                proc_info_set_typeclass_info_varmap(ProcInfo1, 
+                        TypeClassInfoVarMap, ProcInfo2),
+                proc_info_set_typeinfo_varmap(ProcInfo2, 
+                        TypeInfoVarMap, ProcInfo3)
         ;
-                copy_clauses_to_proc(ProcId, ClausesInfo, ProcInfo0, ProcInfo1)
+                copy_clauses_to_proc(ProcId, ClausesInfo, ProcInfo0, ProcInfo3)
         ),
 
         %
         % add the ExtraArgModes to the proc_info argmodes
         %
-        proc_info_argmodes(ProcInfo1, ArgModes1),
+        proc_info_argmodes(ProcInfo3, ArgModes1),
         list__append(ExtraArgModes, ArgModes1, ArgModes),
-        proc_info_set_argmodes(ProcInfo1, ArgModes, ProcInfo).
+        proc_info_set_argmodes(ProcInfo3, ArgModes, ProcInfo).
 
 % XXX the following code ought to be rewritten to handle
 % existential/universal type_infos and type_class_infos
cvs diff: Diffing notes

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