[m-rev.] diff: ml_type_gen.m: don't abort for foreign_type

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Nov 1 03:48:08 AEDT 2001


Branches: main
Estimated hours taken: 0.25

compiler/ml_type_gen.m:
	Don't call error/1 for foreign_type.
	The issues for foreign_type are the same as for eqv_type,
	and so they should be handled the same way.
	It's OK to not generate anything here, because if
	there are any problems, they will result in a link error.
	Calling error/1 would break our current work-around
	for the eqv_type problems (compiling with intermodule
	optimization).

Workspace: /home/earth/fjh/ws-earth3/mercury
Index: compiler/ml_type_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_type_gen.m,v
retrieving revision 1.17
diff -u -d -r1.17 ml_type_gen.m
--- compiler/ml_type_gen.m	25 Oct 2001 12:41:16 -0000	1.17
+++ compiler/ml_type_gen.m	31 Oct 2001 16:41:45 -0000
@@ -106,6 +106,8 @@
 
 ml_gen_type_2(abstract_type, _, _, _) --> [].
 ml_gen_type_2(eqv_type(_EqvType), _, _, _) --> []. % XXX Fixme!
+	% For a description of the problems with equivalence types,
+	% see our BABEL'01 paper "Compiling Mercury to the .NET CLR".
 ml_gen_type_2(uu_type(_), _, _, _) -->
 	{ error("sorry, undiscriminated union types not implemented") }.
 ml_gen_type_2(du_type(Ctors, TagValues, IsEnum, MaybeEqualityPred),
@@ -118,9 +120,8 @@
 		ml_gen_du_parent_type(ModuleInfo, TypeId, TypeDefn,
 			Ctors, TagValues, MaybeEqualityMembers)
 	).
-	% XXX Fixme!
-ml_gen_type_2(foreign_type(_, _), _, _, _) -->
-	{ error("sorry, foreign types not implemented") }.
+	% XXX Fixme!  Same issues here as for eqv_type/1.
+ml_gen_type_2(foreign_type(_, _), _, _, _) --> [].
 
 %-----------------------------------------------------------------------------%
 %

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  | "... it seems to me that 15 years of
The University of Melbourne         | email is plenty for one lifetime."
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- Prof. Donald E. Knuth
--------------------------------------------------------------------------
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