[m-dev.] For review: Using MR_TypeCtorInfo for generated type_ctor_infos
Warwick Harvey
wharvey at cs.monash.edu.au
Wed Aug 4 17:42:54 AEST 1999
This is for Zoltan or Tyson.
As per discussions with Z & T, I've been trying to change Mercury so that hand-defined type_ctor_info structures use the MR_TypeCtorInfo type, rather than having their own. This is mainly so that it is easier for me to merge changes into the HAL branch (which has a an extra field in this structure, so I get major conflicts every time something gets changed).
Anyway, while stumbling around not knowing what I was doing, one thing led to another, and now I have a bootstrapped version of the compiler which uses the MR_TypeCtorInfo type for all type_ctor_info structures, not just the hand-defined ones. I don't know whether this is the right way to go or not (I now know how to change just the hand-defined ones, and doing that instead would not be hard). The drawback with the current implementation is that there are *lots* of warnings about incompatible pointer types and the like when compiling the C files, and at this point I'm not sure what the best way of fixing these is.
I'm also thinking that USE_TYPE_LAYOUT probably isn't worth saving (I think it'd be a fair amount of work to get the compiler to compile without it, and it's been thrown away from so many places that I don't think one would get anything useful out of the exercise anyway). I could easily eliminate it entirely with this change, rather than trying to move back the other way...
Anyway, please give me some feedback on the above issues so I can finalise the direction of this proposed change...
Warwick
Index: compiler/llds_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/llds_out.m,v
retrieving revision 1.115
diff -u -r1.115 llds_out.m
--- llds_out.m 1999/07/13 08:53:06 1.115
+++ llds_out.m 1999/08/04 07:13:54
@@ -2222,16 +2222,25 @@
[]
),
io__write_string("struct "),
- output_decl_id(DeclId),
- io__write_string("_struct"),
+
+ % If it's a type_ctor_info struct, use the MR_TypeCtorInfo_struct
+ % type, and don't emit a definition.
(
- { Def = yes }
+ { decl_id_is_type_ctor_info(DeclId) }
->
- io__write_string(" {\n"),
- output_cons_arg_types(ArgVals, CreateArgTypes, "\t", 1),
- io__write_string("} ")
+ io__write_string("MR_TypeCtorInfo_struct")
;
- []
+ output_decl_id(DeclId),
+ io__write_string("_struct"),
+ (
+ { Def = yes }
+ ->
+ io__write_string(" {\n"),
+ output_cons_arg_types(ArgVals, CreateArgTypes, "\t", 1),
+ io__write_string("} ")
+ ;
+ []
+ )
),
(
{ Decl = yes }
@@ -2251,6 +2260,13 @@
;
io__write_string(";\n")
).
+
+ % Succeed if the decl_id is for a type constructor info structure.
+
+:- pred decl_id_is_type_ctor_info(decl_id).
+:- mode decl_id_is_type_ctor_info(in) is semidet.
+
+decl_id_is_type_ctor_info(data_addr(data_addr(_, type_ctor(info, _, _)))).
% Return true if a data structure of the given type will eventually
% include code addresses. Note that we can't just test the data
Index: library/builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/builtin.m,v
retrieving revision 1.18
diff -u -r1.18 builtin.m
--- builtin.m 1999/07/19 04:50:58 1.18
+++ builtin.m 1999/08/04 07:13:58
@@ -474,29 +474,18 @@
Declare_entry(mercury__builtin_unify_int_2_0);
Declare_entry(mercury__builtin_index_int_2_0);
Declare_entry(mercury__builtin_compare_int_3_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_int_0_struct {
- Integer f1;
- Code *f2;
- Code *f3;
- Code *f4;
-#ifdef USE_TYPE_LAYOUT
- Word f5;
- const Word *f6;
- const Word *f7;
- const Word *f8;
- const Word *f9;
-#endif
-} mercury_data___type_ctor_info_int_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_int_0 = {
((Integer) 0),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_unify_int_2_0)),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_index_int_2_0)),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_compare_int_3_0)),
#ifdef USE_TYPE_LAYOUT
MR_TYPECTOR_REP_INT,
- (const Word *) & mercury_data___type_ctor_functors_int_0,
- (const Word *) & mercury_data___type_ctor_layout_int_0,
- (const Word *) string_const(""builtin"", 7),
- (const Word *) string_const(""int"", 3)
+ (MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_int_0,
+ (MR_TypeCtorLayout) & mercury_data___type_ctor_layout_int_0,
+ (String) string_const(""builtin"", 7),
+ (String) string_const(""int"", 3)
#endif
};
@@ -505,30 +494,18 @@
Declare_entry(mercury__builtin_unify_character_2_0);
Declare_entry(mercury__builtin_index_character_2_0);
Declare_entry(mercury__builtin_compare_character_3_0);
-MR_STATIC_CODE_CONST struct
-mercury_data___type_ctor_info_character_0_struct {
- Integer f1;
- Code *f2;
- Code *f3;
- Code *f4;
-#ifdef USE_TYPE_LAYOUT
- Word f5;
- const Word *f6;
- const Word *f7;
- const Word *f8;
- const Word *f9;
-#endif
-} mercury_data___type_ctor_info_character_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_character_0 = {
((Integer) 0),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_unify_character_2_0)),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_index_character_2_0)),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_compare_character_3_0)),
#ifdef USE_TYPE_LAYOUT
MR_TYPECTOR_REP_CHAR,
- (const Word *) & mercury_data___type_ctor_functors_character_0,
- (const Word *) & mercury_data___type_ctor_layout_character_0,
- (const Word *) string_const(""builtin"", 7),
- (const Word *) string_const(""character"", 9)
+ (MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_character_0,
+ (MR_TypeCtorLayout) & mercury_data___type_ctor_layout_character_0,
+ (String) string_const(""builtin"", 7),
+ (String) string_const(""character"", 9)
#endif
};
@@ -537,29 +514,18 @@
Declare_entry(mercury__builtin_unify_string_2_0);
Declare_entry(mercury__builtin_index_string_2_0);
Declare_entry(mercury__builtin_compare_string_3_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_string_0_struct {
- Integer f1;
- Code *f2;
- Code *f3;
- Code *f4;
-#ifdef USE_TYPE_LAYOUT
- Word f5;
- const Word *f6;
- const Word *f7;
- const Word *f8;
- const Word *f9;
-#endif
-} mercury_data___type_ctor_info_string_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_string_0 = {
((Integer) 0),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_unify_string_2_0)),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_index_string_2_0)),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_compare_string_3_0)),
#ifdef USE_TYPE_LAYOUT
MR_TYPECTOR_REP_STRING,
- (const Word *) & mercury_data___type_ctor_functors_string_0,
- (const Word *) & mercury_data___type_ctor_layout_string_0,
- (const Word *) string_const(""builtin"", 7),
- (const Word *) string_const(""string"", 6)
+ (MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_string_0,
+ (MR_TypeCtorLayout) & mercury_data___type_ctor_layout_string_0,
+ (String) string_const(""builtin"", 7),
+ (String) string_const(""string"", 6)
#endif
};
@@ -568,58 +534,36 @@
Declare_entry(mercury__builtin_unify_float_2_0);
Declare_entry(mercury__builtin_index_float_2_0);
Declare_entry(mercury__builtin_compare_float_3_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_float_0_struct {
- Integer f1;
- Code *f2;
- Code *f3;
- Code *f4;
-#ifdef USE_TYPE_LAYOUT
- Word f5;
- const Word *f6;
- const Word *f7;
- const Word *f8;
- const Word *f9;
-#endif
-} mercury_data___type_ctor_info_float_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_float_0 = {
((Integer) 0),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_unify_float_2_0)),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_index_float_2_0)),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_compare_float_3_0)),
#ifdef USE_TYPE_LAYOUT
MR_TYPECTOR_REP_FLOAT,
- (const Word *) & mercury_data___type_ctor_functors_float_0,
- (const Word *) & mercury_data___type_ctor_layout_float_0,
- (const Word *) string_const(""builtin"", 7),
- (const Word *) string_const(""float"", 5)
+ (MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_float_0,
+ (MR_TypeCtorLayout) & mercury_data___type_ctor_layout_float_0,
+ (String) string_const(""builtin"", 7),
+ (String) string_const(""float"", 5)
#endif
};
/* type_ctor_info for `void' */
Declare_entry(mercury__unused_0_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_void_0_struct {
- Integer f1;
- Code *f2;
- Code *f3;
- Code *f4;
-#ifdef USE_TYPE_LAYOUT
- Word f5;
- const Word *f6;
- const Word *f7;
- const Word *f8;
- const Word *f9;
-#endif
-} mercury_data___type_ctor_info_void_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_void_0 = {
((Integer) 0),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
#ifdef USE_TYPE_LAYOUT
MR_TYPECTOR_REP_VOID,
- (const Word *) & mercury_data___type_ctor_functors_void_0,
- (const Word *) & mercury_data___type_ctor_layout_void_0,
- (const Word *) string_const(""builtin"", 7),
- (const Word *) string_const(""void"", 4)
+ (MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_void_0,
+ (MR_TypeCtorLayout) & mercury_data___type_ctor_layout_void_0,
+ (String) string_const(""builtin"", 7),
+ (String) string_const(""void"", 4)
#endif
};
@@ -628,19 +572,8 @@
/* type_ctor_info for `succip' (only used by accurate gc) */
Declare_entry(mercury__unused_0_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_succip_0_struct {
- Integer f1;
- Code *f2;
- Code *f3;
- Code *f4;
-#ifdef USE_TYPE_LAYOUT
- const Word *f5;
- const Word *f6;
- const Word *f7;
- const Word *f8;
- const Word *f9;
-#endif
-} mercury_data___type_ctor_info_succip_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_succip_0 = {
((Integer) 0),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
@@ -657,19 +590,8 @@
/* type_ctor_info for `hp' (only used by accurate gc) */
Declare_entry(mercury__unused_0_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_hp_0_struct {
- Integer f1;
- Code *f2;
- Code *f3;
- Code *f4;
-#ifdef USE_TYPE_LAYOUT
- const Word *f5;
- const Word *f6;
- const Word *f7;
- const Word *f8;
- const Word *f9;
-#endif
-} mercury_data___type_ctor_info_hp_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_hp_0 = {
((Integer) 0),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
@@ -686,19 +608,8 @@
/* type_ctor_info for `curfr' (only used by accurate gc) */
Declare_entry(mercury__unused_0_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_curfr_0_struct {
- Integer f1;
- Code *f2;
- Code *f3;
- Code *f4;
-#ifdef USE_TYPE_LAYOUT
- const Word *f5;
- const Word *f6;
- const Word *f7;
- const Word *f8;
- const Word *f9;
-#endif
-} mercury_data___type_ctor_info_curfr_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_curfr_0 = {
((Integer) 0),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
@@ -715,19 +626,8 @@
/* type_ctor_info for `maxfr' (only used by accurate gc) */
Declare_entry(mercury__unused_0_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_maxfr_0_struct {
- Integer f1;
- Code *f2;
- Code *f3;
- Code *f4;
-#ifdef USE_TYPE_LAYOUT
- const Word *f5;
- const Word *f6;
- const Word *f7;
- const Word *f8;
- const Word *f9;
-#endif
-} mercury_data___type_ctor_info_maxfr_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_maxfr_0 = {
((Integer) 0),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
@@ -744,19 +644,8 @@
/* type_ctor_info for `redoip' (only used by accurate gc) */
Declare_entry(mercury__unused_0_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_redoip_0_struct {
- Integer f1;
- Code *f2;
- Code *f3;
- Code *f4;
-#ifdef USE_TYPE_LAYOUT
- const Word *f5;
- const Word *f6;
- const Word *f7;
- const Word *f8;
- const Word *f9;
-#endif
-} mercury_data___type_ctor_info_redoip_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_redoip_0 = {
((Integer) 0),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
@@ -773,19 +662,8 @@
/* type_ctor_info for `redofr' (only used by accurate gc) */
Declare_entry(mercury__unused_0_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_redofr_0_struct {
- Integer f1;
- Code *f2;
- Code *f3;
- Code *f4;
-#ifdef USE_TYPE_LAYOUT
- const Word *f5;
- const Word *f6;
- const Word *f7;
- const Word *f8;
- const Word *f9;
-#endif
-} mercury_data___type_ctor_info_redofr_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_redofr_0 = {
((Integer) 0),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
@@ -950,26 +828,19 @@
Define_extern_entry(mercury____Compare___builtin__c_pointer_0_0);
-const struct mercury_data_builtin__type_ctor_info_c_pointer_0_struct {
- Integer f1;
- Code * f2;
- Code * f3;
- Code * f4;
- Integer f5;
- Word * f6;
- Word * f7;
- Word * f8;
- Word * f9;
-} mercury_data_builtin__type_ctor_info_c_pointer_0 = {
+const struct MR_TypeCtorInfo_struct
+mercury_data_builtin__type_ctor_info_c_pointer_0 = {
(Integer) 0,
ENTRY(mercury____Unify___builtin__c_pointer_0_0),
ENTRY(mercury____Index___builtin__c_pointer_0_0),
ENTRY(mercury____Compare___builtin__c_pointer_0_0),
+#ifdef USE_TYPE_LAYOUT
MR_TYPECTOR_REP_C_POINTER,
- (Word *) &mercury_data_builtin__type_ctor_functors_c_pointer_0,
- (Word *) &mercury_data_builtin__type_ctor_layout_c_pointer_0,
- string_const(""builtin"", 7),
- string_const(""c_pointer"", 9)
+ (MR_TypeCtorFunctors) &mercury_data_builtin__type_ctor_functors_c_pointer_0,
+ (MR_TypeCtorLayout) &mercury_data_builtin__type_ctor_layout_c_pointer_0,
+ (String) string_const(""builtin"", 7),
+ (String) string_const(""c_pointer"", 9)
+#endif
};
Index: library/private_builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/private_builtin.m,v
retrieving revision 1.27
diff -u -r1.27 private_builtin.m
--- private_builtin.m 1999/07/06 06:31:58 1.27
+++ private_builtin.m 1999/08/04 07:13:58
@@ -270,17 +270,19 @@
:- pragma c_header_code("
-extern MR_STATIC_CODE_CONST struct
- mercury_data___type_ctor_info_int_0_struct
+ /* These are just for bootstrapping */
+#define mercury_data___type_ctor_info_int_0_struct MR_TypeCtorInfo_struct
+#define mercury_data___type_ctor_info_string_0_struct MR_TypeCtorInfo_struct
+#define mercury_data___type_ctor_info_float_0_struct MR_TypeCtorInfo_struct
+#define mercury_data___type_ctor_info_character_0_struct MR_TypeCtorInfo_struct
+
+extern MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
mercury_data___type_ctor_info_int_0;
-extern MR_STATIC_CODE_CONST struct
- mercury_data___type_ctor_info_string_0_struct
+extern MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
mercury_data___type_ctor_info_string_0;
-extern MR_STATIC_CODE_CONST struct
- mercury_data___type_ctor_info_float_0_struct
+extern MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
mercury_data___type_ctor_info_float_0;
-extern MR_STATIC_CODE_CONST struct
- mercury_data___type_ctor_info_character_0_struct
+extern MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
mercury_data___type_ctor_info_character_0;
").
@@ -304,18 +306,8 @@
** type_ctor_infos.
*/
-MR_STATIC_CODE_CONST struct
-mercury_data_private_builtin__type_ctor_info_type_ctor_info_1_struct {
- Integer f1;
- Code *f2;
- Code *f3;
- Code *f4;
- Word f5;
- const Word *f6;
- const Word *f7;
- const Word *f8;
- const Word *f9;
-} mercury_data_private_builtin__type_ctor_info_type_ctor_info_1 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data_private_builtin__type_ctor_info_type_ctor_info_1 = {
((Integer) 1),
MR_MAYBE_STATIC_CODE(ENTRY(
mercury____Unify___private_builtin__type_info_1_0)),
@@ -323,27 +315,19 @@
mercury____Index___private_builtin__type_info_1_0)),
MR_MAYBE_STATIC_CODE(ENTRY(
mercury____Compare___private_builtin__type_info_1_0)),
+#ifdef USE_TYPE_LAYOUT
MR_TYPECTOR_REP_TYPEINFO,
- (const Word *) &
+ (MR_TypeCtorFunctors) &
mercury_data_private_builtin__type_ctor_functors_type_info_1,
- (const Word *) &
+ (MR_TypeCtorLayout) &
mercury_data_private_builtin__type_ctor_layout_type_info_1,
- (const Word *) string_const(""private_builtin"", 15),
- (const Word *) string_const(""type_ctor_info"", 14)
+ (String) string_const(""private_builtin"", 15),
+ (String) string_const(""type_ctor_info"", 14)
+#endif
};
-MR_STATIC_CODE_CONST struct
-mercury_data_private_builtin__type_ctor_info_type_info_1_struct {
- Integer f1;
- Code *f2;
- Code *f3;
- Code *f4;
- Word f5;
- const Word *f6;
- const Word *f7;
- const Word *f8;
- const Word *f9;
-} mercury_data_private_builtin__type_ctor_info_type_info_1 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data_private_builtin__type_ctor_info_type_info_1 = {
((Integer) 1),
MR_MAYBE_STATIC_CODE(ENTRY(
mercury____Unify___private_builtin__type_info_1_0)),
@@ -351,13 +335,15 @@
mercury____Index___private_builtin__type_info_1_0)),
MR_MAYBE_STATIC_CODE(ENTRY(
mercury____Compare___private_builtin__type_info_1_0)),
+#ifdef USE_TYPE_LAYOUT
MR_TYPECTOR_REP_TYPEINFO,
- (const Word *) &
+ (MR_TypeCtorFunctors) &
mercury_data_private_builtin__type_ctor_functors_type_info_1,
- (const Word *) &
+ (MR_TypeCtorLayout) &
mercury_data_private_builtin__type_ctor_layout_type_info_1,
- (const Word *) string_const(""private_builtin"", 15),
- (const Word *) string_const(""type_info"", 9)
+ (String) string_const(""private_builtin"", 15),
+ (String) string_const(""type_info"", 9)
+#endif
};
@@ -385,18 +371,8 @@
mercury_data_private_builtin__type_ctor_functors_typeclass_info_1_struct
mercury_data_private_builtin__type_ctor_functors_typeclass_info_1;
-MR_STATIC_CODE_CONST struct
-mercury_data_private_builtin__type_ctor_info_base_typeclass_info_1_struct {
- Integer f1;
- Code *f2;
- Code *f3;
- Code *f4;
- Word f5;
- const Word *f6;
- const Word *f7;
- const Word *f8;
- const Word *f9;
-} mercury_data_private_builtin__type_ctor_info_base_typeclass_info_1 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data_private_builtin__type_ctor_info_base_typeclass_info_1 = {
((Integer) 1),
MR_MAYBE_STATIC_CODE(ENTRY(
mercury____Unify___private_builtin__typeclass_info_1_0)),
@@ -404,27 +380,19 @@
mercury____Index___private_builtin__typeclass_info_1_0)),
MR_MAYBE_STATIC_CODE(ENTRY(
mercury____Compare___private_builtin__typeclass_info_1_0)),
+#ifdef USE_TYPE_LAYOUT
MR_TYPECTOR_REP_TYPECLASSINFO,
- (const Word *) &
+ (MR_TypeCtorFunctors) &
mercury_data_private_builtin__type_ctor_functors_typeclass_info_1,
- (const Word *) &
+ (MR_TypeCtorLayout) &
mercury_data_private_builtin__type_ctor_layout_typeclass_info_1,
- (const Word *) string_const(""private_builtin"", 15),
- (const Word *) string_const(""base_typeclass_info"", 19)
+ (String) string_const(""private_builtin"", 15),
+ (String) string_const(""base_typeclass_info"", 19)
+#endif
};
-MR_STATIC_CODE_CONST struct
-mercury_data_private_builtin__type_ctor_info_typeclass_info_1_struct {
- Integer f1;
- Code *f2;
- Code *f3;
- Code *f4;
- Word f5;
- const Word *f6;
- const Word *f7;
- const Word *f8;
- const Word *f9;
-} mercury_data_private_builtin__type_ctor_info_typeclass_info_1 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data_private_builtin__type_ctor_info_typeclass_info_1 = {
((Integer) 1),
MR_MAYBE_STATIC_CODE(ENTRY(
mercury____Unify___private_builtin__typeclass_info_1_0)),
@@ -432,13 +400,15 @@
mercury____Index___private_builtin__typeclass_info_1_0)),
MR_MAYBE_STATIC_CODE(ENTRY(
mercury____Compare___private_builtin__typeclass_info_1_0)),
+#ifdef USE_TYPE_LAYOUT
MR_TYPECTOR_REP_TYPECLASSINFO,
- (const Word *) &
+ (MR_TypeCtorFunctors) &
mercury_data_private_builtin__type_ctor_functors_typeclass_info_1,
- (const Word *) &
+ (MR_TypeCtorLayout) &
mercury_data_private_builtin__type_ctor_layout_typeclass_info_1,
- (const Word *) string_const(""private_builtin"", 15),
- (const Word *) string_const(""typeclass_info"", 14)
+ (String) string_const(""private_builtin"", 15),
+ (String) string_const(""typeclass_info"", 14)
+#endif
};
const struct
Index: runtime/mercury_type_info.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_type_info.h,v
retrieving revision 1.23
diff -u -r1.23 mercury_type_info.h
--- mercury_type_info.h 1999/07/06 06:32:19 1.23
+++ mercury_type_info.h 1999/08/04 07:13:58
@@ -788,11 +788,12 @@
** `:- type' declaration.
*/
-typedef struct {
+struct MR_TypeCtorInfo_struct {
int arity;
Code *unify_pred;
Code *index_pred;
Code *compare_pred;
+#ifdef USE_TYPE_LAYOUT
/*
** The representation that is used for this
** constructor -- e.g. an enumeration, or a builtin
@@ -812,7 +813,9 @@
MR_TypeCtorLayout type_ctor_layout;
String type_ctor_module_name;
String type_ctor_name;
-} *MR_TypeCtorInfo;
+#endif
+};
+typedef struct MR_TypeCtorInfo_struct *MR_TypeCtorInfo;
/*
** Macros for retreiving things from type_ctor_infos.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list