[m-rev.] diff: construct__num_functors for IL backend

Peter Ross pro at missioncriticalit.com
Mon Dec 23 22:47:19 AEDT 2002


On Sun, Dec 22, 2002 at 03:01:00PM +1100, Fergus Henderson wrote:
> So could you please back out this part of your change?
> 

===================================================================


Estimated hours taken: 0.1
Branches: main

library/rtti_implementation.m:
	Back out the change to make rtti_implementatation:type_info
	and rtti_implementatation:type_ctor_info equivalent to
	type_desc:type_desc to type_desc:type_ctor_desc.
	See runtime/mercury_type_desc.h for why they cannot be
	equivalent.

Index: rtti_implementation.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/rtti_implementation.m,v
retrieving revision 1.36
diff -u -r1.36 rtti_implementation.m
--- rtti_implementation.m	20 Dec 2002 16:11:39 -0000	1.36
+++ rtti_implementation.m	23 Dec 2002 11:44:56 -0000
@@ -34,8 +34,10 @@
 :- use_module std_util.
 :- use_module type_desc.
 
-:- type type_info == type_desc__type_desc.
-:- type type_ctor_info == type_desc__type_ctor_desc.
+	% Our type_info and type_ctor_info implementations are both
+	% abstract types.
+:- type type_info.
+:- type type_ctor_info.
 
 :- func get_type_info(T::unused) = (type_info::out) is det.
 
@@ -128,6 +130,8 @@
 
 	% We keep all the other types abstract.
 
+:- type type_ctor_info ---> type_ctor_info(c_pointer).
+:- type type_info ---> type_info(c_pointer).
 :- type compare_pred ---> compare_pred(c_pointer).
 :- type type_functors ---> type_functors(c_pointer).
 :- type type_layout ---> type_layout(c_pointer).
@@ -141,8 +145,8 @@
 %
 
 	% See MR_get_num_functors in runtime/mercury_construct.c
-num_functors(TypeInfo) = NumFunctors :-
-	TypeCtorInfo = get_type_ctor_info(TypeInfo),
+num_functors(TypeDesc) = NumFunctors :-
+	TypeCtorInfo = get_type_ctor_info(unsafe_cast(TypeDesc)),
 	TypeCtorRep = TypeCtorInfo ^ type_ctor_rep,
 	( TypeCtorRep = du,
 		NumFunctors = TypeCtorInfo ^ type_ctor_num_functors

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