[m-rev.] for review: improve procname mangling for .NET backend.

Fergus Henderson fjh at cs.mu.OZ.AU
Fri May 11 14:13:00 AEST 2001


This change broke the MLDS back-end: the test for main/2 is not working
anymore, so it gets link errors when compiling hello world or anything
else.  I have a fix for it below.

On 11-May-2001, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> --- zzlog.mangling4	Wed May  9 23:22:36 2001
> +++ zzlog.mangling5	Thu May 10 21:30:57 2001
> @@ -11,7 +11,11 @@
>  compiler/mlds_to_c.m:
>  compiler/mlds_to_java.m:
>  	Add the code_model and a boolean indicating whether this
> -	function has a non-default (in, in, in, out) mode to the proc_label.
> +	function (if it is a function) *doesn't* have a return value
> +	(i.e. it has a non-default mode).
...
> @@ -1247,26 +1279,22 @@
>  		),
>  		(
>  			PredOrFunc = function,
> -			not (default_func_arg_modes(ArgModes))
> +			ml_is_output_det_function(ModuleInfo, PredId,
> +				ProcId, _)
>  		->
> -			NonDefaultModeFunc = yes
> +			NonOutputFunc = no
>  		;
> -			NonDefaultModeFunc = no
> +			NonOutputFunc = yes
>  		),

I think that is wrong; at any rate, it is not
consistent with the comment:

> +++ compiler/mlds.m
> @@ -1377,7 +1377,8 @@
>  			string,			% name
>  			arity,			% arity
>  			code_model,		% code model
> -			bool			% non-default mode function
> +			bool			% function without return value
> +						% (i.e. non-default mode)
>  		)

The code above sets the bool to `yes' for predicates, but the comments implies
that for predicates it should be set to `no'.

The following patch should fix it.  I'm going to test it a bit
and if it passes, I'll go ahead and commit it.

----------

Estimated hours taken: 0.5
Branches: main

compiler/ml_code_util.m:
	Fix a bug in trd's previous change: it was not setting the "function
	without return value" field correctly for predicates.

Index: ml_code_util.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/ml_code_util.m,v
retrieving revision 1.35
diff -u -d -r1.35 ml_code_util.m
--- ml_code_util.m	2001/05/10 15:07:56	1.35
+++ ml_code_util.m	2001/05/11 04:09:57
@@ -1279,12 +1279,12 @@
 		),
 		(
 			PredOrFunc = function,
-			ml_is_output_det_function(ModuleInfo, PredId,
+			\+ ml_is_output_det_function(ModuleInfo, PredId,
 				ProcId, _)
 		->
-			NonOutputFunc = no
-		;
 			NonOutputFunc = yes
+		;
+			NonOutputFunc = no
 		),
 		MLDS_PredLabel = pred(PredOrFunc, MaybeDeclaringModule,
 				PredName, PredArity, CodeModel,
-- 
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-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