[m-rev.] diff: use lowlevel representation for private_builtin.ref/1

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Nov 13 04:28:04 AEDT 2003


On 12-Nov-2003, Peter Ross <pro at missioncriticalit.com> wrote:
> The type private_builtin.ref/1 is abstract,

It's not just abstract; we have lots of abstract types.
The issue here is that there is no Mercury definition for this type.

> compiler/ml_util.m:
> 	Add private_builtin.ref/1 to the list of types which need a lowlevel
> 	representation.
...
> +++ compiler/ml_util.m	12 Nov 2003 16:37:20 -0000
> @@ -633,6 +633,7 @@
>  	; TypeName = qualified(PrivateBuiltin, "type_ctor_info")
>  	; TypeName = qualified(PrivateBuiltin, "typeclass_info")
>  	; TypeName = qualified(PrivateBuiltin, "type_info")
> +	; TypeName = qualified(PrivateBuiltin, "ref")

That's not quite the right spot to add it.  It should go under the comment
"Types which don't have a Mercury representation".  So I have applied
the following patch.

----------

Estimated hours taken: 0.25
Branches: main

compiler/ml_util.m:
	Reorder some code, so that it goes next to the comment which
	describes it.  Also, fix a misleading comment.

Index: ml_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_util.m,v
retrieving revision 1.26
diff -u -d -u -r1.26 ml_util.m
--- ml_util.m	12 Nov 2003 16:43:13 -0000	1.26
+++ ml_util.m	12 Nov 2003 17:20:18 -0000
@@ -633,7 +633,6 @@
 	; TypeName = qualified(PrivateBuiltin, "type_ctor_info")
 	; TypeName = qualified(PrivateBuiltin, "typeclass_info")
 	; TypeName = qualified(PrivateBuiltin, "type_info")
-	; TypeName = qualified(PrivateBuiltin, "ref")
 
 		% Use lowlevel types for all types in rtti_implementation
 		% as this allows as to add new types needed to manipulate
@@ -644,10 +643,11 @@
 	; TypeName = qualified(TypeDesc, "type_ctor_desc")
 
 		% Types which don't have a Mercury representation.
+	; TypeName = qualified(PrivateBuiltin, "ref")
 	; TypeName = qualified(PrivateBuiltin, "heap_pointer")
 	; TypeName = qualified(Builtin, "c_pointer")
 
-		% XXX These two types are referenced in IL and C# code,
+		% XXX These types are referenced in IL and C# code,
 		% so it is easier to just keep their low level representation
 		% for the moment.
 	; TypeName = qualified(Builtin, "comparison_result")

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