[m-dev.] for review: fix MLDS static ground term bugs

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Oct 23 00:56:32 AEDT 2000


On 22-Oct-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 22-Oct-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > This change fixes several closely related bugs where the MLDS compiler
> > would generatic static ground terms whose initializers referred to
> > variables which weren't in scope.  Unfortunately the fix isn't
> > yet complete: AFAIK it fixes all such problems in the MLDS generated
> > by the code generator, but the ml_elim_nested pass that follows still
> > screws things up.
> 
> OK, now I've fixed ml_elim_nested too.
> If they pass the bootcheck, I'll go ahead and commit these changes.

Almost.  I missed one thing.  The log message

	compiler/ml_unify_gen.m:
		Ensure that all static consts get unique names, so that
		ml_elim_nested.m can hoist them to the top level.

was right, but the the code was not.  Relative diff below.
I'll go ahead and commit all this now.

--- compiler/ml_unify_gen.m
+++ compiler/ml_unify_gen.m
@@ -1095 +1095,8 @@
-		{ string__format("float_%d", [i(SequenceNum)], ConstName) },
+		=(MLDSGenInfo),
+		{ ml_gen_info_get_pred_id(MLDSGenInfo, PredId) },
+		{ ml_gen_info_get_proc_id(MLDSGenInfo, ProcId) },
+		{ pred_id_to_int(PredId, PredIdNum) },
+		{ proc_id_to_int(ProcId, ProcIdNum) },
+		{ string__format("float_%d_%d_%d",
+			[i(PredIdNum), i(ProcIdNum), i(SequenceNum)],
+			ConstName) },

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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