[m-rev.] diff: improve MLDS dumps

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Jul 13 09:22:44 AEST 2001


On 13-Jul-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> 
> Improve MLDS dumps: as well as dumping the raw MLDS,
> also convert the MLDS to C and dump that.
> This is useful for showing the intermediate stages,
> and for debugging non-C targets.

One more small change was needed...

Estimated hours taken: 0.25
Branches: main

compiler/mlds_to_c.m:
	Don't abort if a class contains constructors.
	Instead, just treat the constructors like member functions.

	This is needed to avoid spurious aborts when using the
	`--dump-mlds' option.  There's no need for us to abort here,
	because if it's really going to be a problem then the C compiler
	will catch it.

Workspace: /home/mars/fjh/ws2/mercury
Index: compiler/mlds_to_c.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_c.m,v
retrieving revision 1.96
diff -u -d -r1.96 mlds_to_c.m
--- compiler/mlds_to_c.m	2001/07/12 22:19:58	1.96
+++ compiler/mlds_to_c.m	2001/07/12 23:00:50
@@ -969,14 +969,9 @@
 	% not when compiling to C++
 	%
 	{ ClassDefn = class_defn(Kind, _Imports, BaseClasses, _Implements,
-		Ctors, AllMembers) },
-
-	{ Ctors = [] ->
-		true
-	;
-		unexpected(this_file,
-			"mlds_output_class: non empty constructor list")
-	},
+		Ctors, Members) },
+	
+	{ AllMembers = Ctors ++ Members },
 
 	( { Kind = mlds__enum } ->
 		{ StaticMembers = [] },
-- 
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