[m-rev.] diff: mlds_to_c.m: handle self/1

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Aug 17 23:09:33 AEST 2001


Estimated hours taken: 0.25
Branches: main

compiler/mlds_to_c.m:
	Don't abort if a `self(Type)' rval is encountered; just output "this".
	mlds_to_c.m needs to able able to dump all MLDS constructs,
	since it is used by the --dump-mlds option.

	Also clarify a comment.

Workspace: /home/earth/fjh/ws-earth2/mercury
Index: compiler/mlds_to_c.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_c.m,v
retrieving revision 1.101
diff -u -d -r1.101 mlds_to_c.m
--- compiler/mlds_to_c.m	2001/08/11 12:33:52	1.101
+++ compiler/mlds_to_c.m	2001/08/17 13:04:39
@@ -10,7 +10,11 @@
 % TODO:
 %	- RTTI for debugging (module_layout, proc_layout, internal_layout)
 %	- trail ops
-%	- foreign language interfacing (trd: what does this mean?)
+%	- foreign language interfacing for languages other than C
+%	  (handle `user_foreign_code' and `foreign_code_decl' --
+%	  actually perhaps this should be done in an earlier pass,
+%	  in which case the only thing that would need to be done here
+%	  is to change some calls to sorry/2 to unexpected/2).
 %	- packages, classes and inheritance
 %	  (currently we just generate all classes as structs)
 
@@ -2764,7 +2768,7 @@
 	mlds_output_lval(Lval).
 
 mlds_output_rval(self(_)) -->
-	{ error("mlds_to_c: self rval encountered.\n") }.
+	io__write_string("this").
 
 :- pred mlds_output_unop(mlds__unary_op, mlds__rval, io__state, io__state).
 :- mode mlds_output_unop(in, in, di, uo) is det.

-- 
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