[m-rev.] diff: IL back-end: fix --high-level-data ordering bug

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Aug 12 18:30:51 AEST 2001


Estimated hours taken: 1
Branches: main

compiler/mlds_to_il.m:
	Fix a bug that broke things with --high-level-data: make sure
	that the type definitions come before the "mercury_code" class
	that references them.  ILASM requires the types to be defined
	before they are referenced.

Workspace: /home/venus/fjh/ws-venus4/mercury
Index: compiler/mlds_to_il.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_il.m,v
retrieving revision 1.61
diff -u -d -r1.61 mlds_to_il.m
--- compiler/mlds_to_il.m	5 Aug 2001 06:25:30 -0000	1.61
+++ compiler/mlds_to_il.m	12 Aug 2001 08:27:51 -0000
@@ -262,9 +262,10 @@
 			; D = mlds__defn(_, _, _, mlds__data(_, _))
 			)
 		), MLDS0 ^ defns, MercuryCodeMembers, Others),
-	MLDS = MLDS0 ^ defns := [wrapper_class(
-			list__map(rename_defn, MercuryCodeMembers)) | 
-			list__map(rename_defn, Others)].
+	WrapperClass = wrapper_class(list__map(rename_defn, MercuryCodeMembers)),
+		% Note that ILASM requires that the type definitions in Others
+		% must precede the references to those types in WrapperClass.
+	MLDS = MLDS0 ^ defns := list__map(rename_defn, Others) ++ [WrapperClass].
 
 
 :- func wrapper_class(mlds__defns) = mlds__defn.

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