[m-rev.] diff: minor tweaks to ml_call_gen.m

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Mar 6 15:25:45 AEDT 2002


Branches: main
Estimated hours taken: 0.5

compiler/ml_call_gen.m:
	Avoid some unnecessary code duplication, and improve the
	documentation about GC trace handling code.

Workspace: /home/ceres/fjh/mercury
Index: compiler/ml_call_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_call_gen.m,v
retrieving revision 1.30
diff -u -d -r1.30 ml_call_gen.m
--- compiler/ml_call_gen.m	6 Feb 2002 18:44:18 -0000	1.30
+++ compiler/ml_call_gen.m	4 Mar 2002 11:45:22 -0000
@@ -123,10 +123,7 @@
 	% of the boxed arguments
 	%
 	{ NumArgs = list__length(ArgVars) },
-	{ varset__init(TypeVarSet0) },
-	{ varset__new_vars(TypeVarSet0, NumArgs, ArgTypeVars,
-		_TypeVarSet) },
-	{ term__var_list_to_term_list(ArgTypeVars, BoxedArgTypes) },
+	{ BoxedArgTypes = ml_make_boxed_types(NumArgs) },
 
 	%
 	% create the boxed parameter types for the called function
@@ -143,8 +140,13 @@
 	%
 	% insert the `closure_arg' parameter
 	%
-	% XXX The GC handling for `closure_arg' here is wrong
-	{ GC_TraceCode = no }, % XXX wrong
+	% The GC_TraceCode for `closure_arg' here is wrong,
+	% but it doesn't matter, since `closure_arg' is only part
+	% of a type (a function parameter in the function type).
+	% We won't use the GC tracing code generated here, since we don't
+	% generate any actual local variable or parameter for `closure_arg'.
+	%
+	{ GC_TraceCode = no },
 	{ ClosureArgType = mlds__generic_type },
 	{ ClosureArg = mlds__argument(
 		data(var(var_name("closure_arg", no))),

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list