[m-rev.] for post-commit review: step 3 of eliminating type_info/1's argument
Zoltan Somogyi
zs at cs.mu.OZ.AU
Tue Sep 27 12:44:50 AEST 2005
This is step 3 of eliminating the arguments of the type_ctor_info, type_info,
base_typeclass_info and typeclass_info type constructors. This step eliminates
the temporary replacement types with the zero_ prefixes on their names.
library/private_builtin.m:
Remove the temporary replacement type constructors and the predicates
that operate on them.
runtime/mercury_builtin_types.[ch]:
Remove the unify and compare predicates of the temporary replacement
type constructors.
runtime/mercury_type_info.h:
runtime/mercury_grade.h:
Increase binary compatibility version numbers to reflect the
requirement on the compiler to generate references to arity-0 variants
of type_ctor_info, type_info, base_typeclass_info and typeclass_info.
runtime/mercury_type_info.h:
runtime/mercury_make_type_info_body.h:
compiler/type_ctor_info.m:
Remove support for fake_arity types, since there aren't any anymore.
trace/mercury_trace_vars.c:
Remove references to the temporary replacement type constructors.
The coming step 4 will modify configure.in to require the new binary
compatibility version number.
Zoltan.
cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/rtti.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rtti.m,v
retrieving revision 1.57
diff -u -b -r1.57 rtti.m
--- compiler/rtti.m 22 Mar 2005 06:40:24 -0000 1.57
+++ compiler/rtti.m 23 Sep 2005 03:38:00 -0000
@@ -120,8 +120,7 @@
:- type type_ctor_flag
---> reserve_tag_flag
; variable_arity_flag
- ; kind_of_du_flag
- ; typeinfo_fake_arity_flag.
+ ; kind_of_du_flag.
% A type_ctor_details structure contains all the information that the
% runtime system needs to know about the data representation scheme
@@ -813,7 +812,6 @@
encode_type_ctor_flag(reserve_tag_flag, N) = N + 1.
encode_type_ctor_flag(variable_arity_flag, N) = N + 2.
encode_type_ctor_flag(kind_of_du_flag, N) = N + 4.
-encode_type_ctor_flag(typeinfo_fake_arity_flag, N) = N + 8.
rtti_data_to_id(type_ctor_info(TypeCtorData),
ctor_rtti_id(RttiTypeCtor, type_ctor_info)) :-
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing debian/patches
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_glut
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/solver_types
cvs diff: Diffing extras/solver_types/library
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
Index: library/private_builtin.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/private_builtin.m,v
retrieving revision 1.144
diff -u -b -r1.144 private_builtin.m
--- library/private_builtin.m 22 Sep 2005 06:17:27 -0000 1.144
+++ library/private_builtin.m 23 Sep 2005 03:41:03 -0000
@@ -282,15 +282,9 @@
:- type type_info.
:- type type_ctor_info.
-:- type zero_type_info.
-:- type zero_type_ctor_info.
-
:- type typeclass_info.
:- type base_typeclass_info.
-:- type zero_typeclass_info.
-:- type zero_base_typeclass_info.
-
% The following types are used by compiler/ml_code_util.m as the types
% used for copying type_info/1 and typeclass_info/1 types.
% XXX Document me better
@@ -318,8 +312,6 @@
%
:- pred type_info_from_typeclass_info(typeclass_info::in, int::in,
type_info::out) is det.
-:- pred zero_type_info_from_typeclass_info(zero_typeclass_info::in, int::in,
- zero_type_info::out) is det.
% unconstrained_type_info_from_typeclass_info(TypeClassInfo,
% Index, TypeInfo):
@@ -329,8 +321,6 @@
%
:- pred unconstrained_type_info_from_typeclass_info(typeclass_info::in,
int::in, type_info::out) is det.
-:- pred zero_unconstrained_type_info_from_typeclass_info(
- zero_typeclass_info::in, int::in, zero_type_info::out) is det.
% superclass_from_typeclass_info(TypeClassInfo, Index, SuperClass):
%
@@ -339,8 +329,6 @@
%
:- pred superclass_from_typeclass_info(typeclass_info::in,
int::in, typeclass_info::out) is det.
-:- pred zero_superclass_from_typeclass_info(zero_typeclass_info::in,
- int::in, zero_typeclass_info::out) is det.
% instance_constraint_from_typeclass_info(TypeClassInfo, Index,
% InstanceConstraintTypeClassInfo):
@@ -353,8 +341,6 @@
%
:- pred instance_constraint_from_typeclass_info(typeclass_info::in,
int::in, typeclass_info::out) is det.
-:- pred zero_instance_constraint_from_typeclass_info(zero_typeclass_info::in,
- int::in, zero_typeclass_info::out) is det.
% N.B. interface continued below.
@@ -572,14 +558,6 @@
").
:- pragma foreign_proc("C",
- zero_type_info_from_typeclass_info(TypeClassInfo::in, Index::in,
- TypeInfo::out),
- [will_not_call_mercury, promise_pure, thread_safe],
-"
- TypeInfo = MR_typeclass_info_param_type_info(TypeClassInfo, Index);
-").
-
-:- pragma foreign_proc("C",
unconstrained_type_info_from_typeclass_info(TypeClassInfo::in,
Index::in, TypeInfo::out),
[will_not_call_mercury, promise_pure, thread_safe],
@@ -588,14 +566,6 @@
").
:- pragma foreign_proc("C",
- zero_unconstrained_type_info_from_typeclass_info(TypeClassInfo::in,
- Index::in, TypeInfo::out),
- [will_not_call_mercury, promise_pure, thread_safe],
-"
- TypeInfo = MR_typeclass_info_instance_tvar_type_info(TypeClassInfo, Index);
-").
-
-:- pragma foreign_proc("C",
superclass_from_typeclass_info(TypeClassInfo0::in, Index::in,
TypeClassInfo::out),
[will_not_call_mercury, promise_pure, thread_safe],
@@ -605,15 +575,6 @@
").
:- pragma foreign_proc("C",
- zero_superclass_from_typeclass_info(TypeClassInfo0::in, Index::in,
- TypeClassInfo::out),
- [will_not_call_mercury, promise_pure, thread_safe],
-"
- TypeClassInfo =
- MR_typeclass_info_superclass_info(TypeClassInfo0, Index);
-").
-
-:- pragma foreign_proc("C",
instance_constraint_from_typeclass_info(TypeClassInfo0::in,
Index::in, TypeClassInfo::out),
[will_not_call_mercury, promise_pure, thread_safe],
@@ -622,15 +583,6 @@
MR_typeclass_info_arg_typeclass_info(TypeClassInfo0, Index);
").
-:- pragma foreign_proc("C",
- zero_instance_constraint_from_typeclass_info(TypeClassInfo0::in,
- Index::in, TypeClassInfo::out),
- [will_not_call_mercury, promise_pure, thread_safe],
-"
- TypeClassInfo =
- MR_typeclass_info_arg_typeclass_info(TypeClassInfo0, Index);
-").
-
:- pragma foreign_proc("C#",
type_info_from_typeclass_info(TypeClassInfo::in, Index::in,
TypeInfo::out),
@@ -1195,14 +1147,14 @@
&MR_TYPE_CTOR_INFO_NAME(std_util, univ, 0);
const MR_TypeCtorInfo ML_type_info_for_type_info =
- &MR_TYPE_CTOR_INFO_NAME(private_builtin, zero_type_info, 0);
+ &MR_TYPE_CTOR_INFO_NAME(private_builtin, type_info, 0);
const MR_TypeCtorInfo ML_type_info_for_pseudo_type_info =
/*
** For the time being, we handle pseudo_type_infos the same way
** as we handle type_infos.
*/
- &MR_TYPE_CTOR_INFO_NAME(private_builtin, zero_type_info, 0);
+ &MR_TYPE_CTOR_INFO_NAME(private_builtin, type_info, 0);
const MR_FA_TypeInfo_Struct1 ML_type_info_for_list_of_univ = {
&MR_TYPE_CTOR_INFO_NAME(list, list, 1),
cvs diff: Diffing mdbcomp
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
Index: runtime/mercury_builtin_types.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_builtin_types.c,v
retrieving revision 1.15
diff -u -b -r1.15 mercury_builtin_types.c
--- runtime/mercury_builtin_types.c 22 Sep 2005 06:17:31 -0000 1.15
+++ runtime/mercury_builtin_types.c 23 Sep 2005 03:40:09 -0000
@@ -82,15 +82,6 @@
MR_DEFINE_TYPE_CTOR_INFO(private_builtin, typeclass_info, 0,
TYPECLASSINFO);
-MR_DEFINE_TYPE_CTOR_INFO(private_builtin, zero_type_ctor_info, 0,
- TYPECTORINFO);
-MR_DEFINE_TYPE_CTOR_INFO(private_builtin, zero_type_info, 0,
- TYPEINFO);
-MR_DEFINE_TYPE_CTOR_INFO(private_builtin, zero_base_typeclass_info, 0,
- BASETYPECLASSINFO);
-MR_DEFINE_TYPE_CTOR_INFO(private_builtin, zero_typeclass_info, 0,
- TYPECLASSINFO);
-
MR_DEFINE_TYPE_CTOR_INFO(type_desc, type_ctor_desc, 0, TYPECTORDESC);
MR_DEFINE_TYPE_CTOR_INFO(type_desc, pseudo_type_desc, 0, PSEUDOTYPEDESC);
MR_DEFINE_TYPE_CTOR_INFO(type_desc, type_desc, 0, TYPEDESC);
@@ -253,39 +244,6 @@
return MR_TRUE;
}
-MR_bool MR_CALL
-mercury__private_builtin____Unify____zero_type_ctor_info_0_0(
- MR_Mercury_Type_Ctor_Info x, MR_Mercury_Type_Ctor_Info y)
-{
- return MR_unify_type_ctor_info((MR_TypeCtorInfo) x,
- (MR_TypeCtorInfo) y);
-}
-
-MR_bool MR_CALL
-mercury__private_builtin____Unify____zero_type_info_0_0(
- MR_Mercury_Type_Info x, MR_Mercury_Type_Info y)
-{
- return MR_unify_type_info((MR_TypeInfo) x, (MR_TypeInfo) y);
-}
-
-MR_bool MR_CALL
-mercury__private_builtin____Unify____zero_typeclass_info_0_0(
- MR_Mercury_TypeClass_Info x, MR_Mercury_TypeClass_Info y)
-{
- MR_fatal_error("called unify/2 for `typeclass_info' type");
-
- return MR_TRUE;
-}
-
-MR_bool MR_CALL
-mercury__private_builtin____Unify____zero_base_typeclass_info_0_0(
- MR_Mercury_Base_TypeClass_Info x, MR_Mercury_Base_TypeClass_Info y)
-{
- MR_SORRY("unify for base_typeclass_info");
-
- return MR_TRUE;
-}
-
/*---------------------------------------------------------------------------*/
/*
@@ -443,39 +401,6 @@
MR_SORRY("compare for base_typeclass_info");
}
-void MR_CALL
-mercury__private_builtin____Compare____zero_type_ctor_info_0_0(
- MR_Comparison_Result *result,
- MR_Mercury_Type_Ctor_Info x, MR_Mercury_Type_Ctor_Info y)
-{
- *result = MR_compare_type_ctor_info((MR_TypeCtorInfo) x,
- (MR_TypeCtorInfo) y);
-}
-
-void MR_CALL
-mercury__private_builtin____Compare____zero_type_info_0_0(
- MR_Comparison_Result *result,
- MR_Mercury_Type_Info x, MR_Mercury_Type_Info y)
-{
- *result = MR_compare_type_info((MR_TypeInfo) x, (MR_TypeInfo) y);
-}
-
-void MR_CALL
-mercury__private_builtin____Compare____zero_typeclass_info_0_0(
- MR_Comparison_Result *result,
- MR_Mercury_TypeClass_Info x, MR_Mercury_TypeClass_Info y)
-{
- MR_fatal_error("called compare/3 for `typeclass_info' type");
-}
-
-void MR_CALL
-mercury__private_builtin____Compare____zero_base_typeclass_info_0_0(
- MR_Comparison_Result *result,
- MR_Mercury_Base_TypeClass_Info x, MR_Mercury_Base_TypeClass_Info y)
-{
- MR_SORRY("compare for base_typeclass_info");
-}
-
/*---------------------------------------------------------------------------*/
/*
@@ -618,39 +543,6 @@
(MR_Mercury_Base_TypeClass_Info) y);
}
-MR_bool MR_CALL
-mercury__private_builtin__do_unify__zero_type_ctor_info_0_0(
- MR_Box x, MR_Box y)
-{
- return mercury__private_builtin____Unify____zero_type_ctor_info_0_0(
- (MR_Mercury_Type_Ctor_Info) x, (MR_Mercury_Type_Ctor_Info) y);
-}
-
-MR_bool MR_CALL
-mercury__private_builtin__do_unify__zero_type_info_0_0(
- MR_Box x, MR_Box y)
-{
- return mercury__private_builtin____Unify____zero_type_info_0_0(
- (MR_Mercury_Type_Info) x, (MR_Mercury_Type_Info) y);
-}
-
-MR_bool MR_CALL
-mercury__private_builtin__do_unify__zero_typeclass_info_0_0(
- MR_Box x, MR_Box y)
-{
- return mercury__private_builtin____Unify____zero_typeclass_info_0_0(
- (MR_Mercury_TypeClass_Info) x, (MR_Mercury_TypeClass_Info) y);
-}
-
-MR_bool MR_CALL
-mercury__private_builtin__do_unify__zero_base_typeclass_info_0_0(
- MR_Box x, MR_Box y)
-{
- return mercury__private_builtin____Unify____zero_base_typeclass_info_0_0(
- (MR_Mercury_Base_TypeClass_Info) x,
- (MR_Mercury_Base_TypeClass_Info) y);
-}
-
/*---------------------------------------------------------------------------*/
/*
@@ -800,42 +692,6 @@
(MR_Mercury_Base_TypeClass_Info) y);
}
-void MR_CALL
-mercury__private_builtin__do_compare__zero_type_ctor_info_0_0(
- MR_Comparison_Result *result, MR_Box x, MR_Box y)
-{
- mercury__private_builtin____Compare____zero_type_ctor_info_0_0(
- result,
- (MR_Mercury_Type_Ctor_Info) x, (MR_Mercury_Type_Ctor_Info) y);
-}
-
-void MR_CALL
-mercury__private_builtin__do_compare__zero_type_info_0_0(
- MR_Comparison_Result *result, MR_Box x, MR_Box y)
-{
- mercury__private_builtin____Compare____zero_type_info_0_0(
- result, (MR_Mercury_Type_Info) x, (MR_Mercury_Type_Info) y);
-}
-
-void MR_CALL
-mercury__private_builtin__do_compare__zero_typeclass_info_0_0(
- MR_Comparison_Result *result, MR_Box x, MR_Box y)
-{
- mercury__private_builtin____Compare____zero_typeclass_info_0_0(
- result,
- (MR_Mercury_TypeClass_Info) x, (MR_Mercury_TypeClass_Info) y);
-}
-
-void MR_CALL
-mercury__private_builtin__do_compare__zero_base_typeclass_info_0_0(
- MR_Comparison_Result *result, MR_Box x, MR_Box y)
-{
- mercury__private_builtin____Compare____zero_base_typeclass_info_0_0(
- result,
- (MR_Mercury_Base_TypeClass_Info) x,
- (MR_Mercury_Base_TypeClass_Info) y);
-}
-
#else /* ! MR_HIGHLEVEL_CODE */
MR_MODULE_STATIC_OR_EXTERN MR_ModuleFunc mercury_builtin_types;
@@ -910,10 +766,6 @@
MR_UNIFY_COMPARE_REP_DECLS(private_builtin, type_info, 0)
MR_UNIFY_COMPARE_REP_DECLS(private_builtin, base_typeclass_info, 0)
MR_UNIFY_COMPARE_REP_DECLS(private_builtin, typeclass_info, 0)
-MR_UNIFY_COMPARE_REP_DECLS(private_builtin, zero_type_ctor_info, 0)
-MR_UNIFY_COMPARE_REP_DECLS(private_builtin, zero_type_info, 0)
-MR_UNIFY_COMPARE_REP_DECLS(private_builtin, zero_base_typeclass_info, 0)
-MR_UNIFY_COMPARE_REP_DECLS(private_builtin, zero_typeclass_info, 0)
MR_UNIFY_COMPARE_REP_DECLS(type_desc, type_ctor_desc, 0);
MR_UNIFY_COMPARE_REP_DECLS(type_desc, pseudo_type_desc, 0);
MR_UNIFY_COMPARE_REP_DECLS(type_desc, type_desc, 0);
@@ -942,10 +794,6 @@
MR_UNIFY_COMPARE_REP_DEFNS(private_builtin, type_info, 0)
MR_UNIFY_COMPARE_REP_DEFNS(private_builtin, base_typeclass_info, 0)
MR_UNIFY_COMPARE_REP_DEFNS(private_builtin, typeclass_info, 0)
-MR_UNIFY_COMPARE_REP_DEFNS(private_builtin, zero_type_ctor_info, 0)
-MR_UNIFY_COMPARE_REP_DEFNS(private_builtin, zero_type_info, 0)
-MR_UNIFY_COMPARE_REP_DEFNS(private_builtin, zero_base_typeclass_info, 0)
-MR_UNIFY_COMPARE_REP_DEFNS(private_builtin, zero_typeclass_info, 0)
MR_UNIFY_COMPARE_REP_DEFNS(type_desc, type_ctor_desc, 0)
MR_UNIFY_COMPARE_REP_DEFNS(type_desc, pseudo_type_desc, 0)
MR_UNIFY_COMPARE_REP_DEFNS(type_desc, type_desc, 0)
@@ -1021,10 +869,6 @@
MR_DEFINE_PROC_STATIC_LAYOUTS(private_builtin, type_info, 0);
MR_DEFINE_PROC_STATIC_LAYOUTS(private_builtin, base_typeclass_info, 0);
MR_DEFINE_PROC_STATIC_LAYOUTS(private_builtin, typeclass_info, 0);
-MR_DEFINE_PROC_STATIC_LAYOUTS(private_builtin, zero_type_ctor_info, 0);
-MR_DEFINE_PROC_STATIC_LAYOUTS(private_builtin, zero_type_info, 0);
-MR_DEFINE_PROC_STATIC_LAYOUTS(private_builtin, zero_base_typeclass_info, 0);
-MR_DEFINE_PROC_STATIC_LAYOUTS(private_builtin, zero_typeclass_info, 0);
MR_DEFINE_PROC_STATIC_LAYOUTS(type_desc, type_ctor_desc, 0);
MR_DEFINE_PROC_STATIC_LAYOUTS(type_desc, pseudo_type_desc, 0);
MR_DEFINE_PROC_STATIC_LAYOUTS(type_desc, type_desc, 0);
@@ -1056,10 +900,6 @@
MR_UNIFY_COMPARE_REP_LABELS(private_builtin, type_info, 0)
MR_UNIFY_COMPARE_REP_LABELS(private_builtin, base_typeclass_info, 0)
MR_UNIFY_COMPARE_REP_LABELS(private_builtin, typeclass_info, 0)
- MR_UNIFY_COMPARE_REP_LABELS(private_builtin, zero_type_ctor_info, 0)
- MR_UNIFY_COMPARE_REP_LABELS(private_builtin, zero_type_info, 0)
- MR_UNIFY_COMPARE_REP_LABELS(private_builtin, zero_base_typeclass_info, 0)
- MR_UNIFY_COMPARE_REP_LABELS(private_builtin, zero_typeclass_info, 0)
MR_UNIFY_COMPARE_REP_LABELS(type_desc, type_ctor_desc, 0)
MR_UNIFY_COMPARE_REP_LABELS(type_desc, pseudo_type_desc, 0)
MR_UNIFY_COMPARE_REP_LABELS(type_desc, type_desc, 0)
@@ -1570,118 +1410,6 @@
/*****************************************************************************/
/*
-** Unify and compare of type_ctor_infos are usually handled by the generic
-** unify/2 and compare/3 predicates.
-*/
-
-#define module private_builtin
-#define type zero_type_ctor_info
-#define arity 0
-#define unify_code int comp; \
- \
- MR_save_transient_registers(); \
- comp = MR_compare_type_ctor_info( \
- (MR_TypeCtorInfo) MR_r1, \
- (MR_TypeCtorInfo) MR_r2); \
- MR_restore_transient_registers(); \
- MR_r1 = (comp == MR_COMPARE_EQUAL);
-#define compare_code int comp; \
- \
- MR_save_transient_registers(); \
- comp = MR_compare_type_ctor_info( \
- (MR_TypeCtorInfo) MR_r1, \
- (MR_TypeCtorInfo) MR_r2); \
- MR_restore_transient_registers(); \
- MR_r1 = comp;
-
-#include "mercury_hand_unify_compare_body.h"
-
-#undef module
-#undef type
-#undef arity
-#undef unify_code
-#undef compare_code
-
-/*****************************************************************************/
-
-/*
-** Unify and compare of type_infos are usually handled by the generic
-** unify/2 and compare/3 predicates.
-*/
-
-#define module private_builtin
-#define type zero_type_info
-#define arity 0
-#define unify_code int comp; \
- \
- MR_save_transient_registers(); \
- comp = MR_compare_type_info( \
- (MR_TypeInfo) MR_r1, \
- (MR_TypeInfo) MR_r2); \
- MR_restore_transient_registers(); \
- MR_r1 = (comp == MR_COMPARE_EQUAL);
-#define compare_code int comp; \
- \
- MR_save_transient_registers(); \
- comp = MR_compare_type_info( \
- (MR_TypeInfo) MR_r1, \
- (MR_TypeInfo) MR_r2); \
- MR_restore_transient_registers(); \
- MR_r1 = comp;
-
-#include "mercury_hand_unify_compare_body.h"
-
-#undef module
-#undef type
-#undef arity
-#undef unify_code
-#undef compare_code
-
-/*****************************************************************************/
-
-/*
-** Unify and compare of base_typeclass_infos are always handled by the generic
-** unify/2 and compare/3 predicates.
-*/
-
-#define module private_builtin
-#define type zero_base_typeclass_info
-#define arity 0
-#define unify_code MR_fatal_error("called unify/2 for `base_typeclass_info' type");
-#define compare_code MR_fatal_error("called compare/3 for `base_typeclass_info' type");
-
-#include "mercury_hand_unify_compare_body.h"
-
-#undef module
-#undef type
-#undef arity
-#undef unify_code
-#undef compare_code
-
-/*****************************************************************************/
-
-/*
-** Unify and compare of typeclass_infos are always handled by the generic
-** unify/2 and compare/3 predicates.
-*/
-
-#define module private_builtin
-#define type zero_typeclass_info
-#define arity 0
-#define unify_code MR_fatal_error("called unify/2 for `base_typeclass_info' type");
-#define compare_code MR_fatal_error("called compare/3 for `base_typeclass_info' type");
-
-#include "mercury_hand_unify_compare_body.h"
-
-#undef module
-#undef type
-#undef arity
-#undef unify_code
-#undef compare_code
-
-/*****************************************************************************/
-
-/*
** Unify and compare of type_ctor_descs are usually handled by the generic
** unify/2 and compare/3 predicates.
*/
@@ -1894,10 +1622,6 @@
MR_INIT_TYPE_CTOR_INFO_MNA(private_builtin, type_info, 0);
MR_INIT_TYPE_CTOR_INFO_MNA(private_builtin, base_typeclass_info, 0);
MR_INIT_TYPE_CTOR_INFO_MNA(private_builtin, typeclass_info, 0);
- MR_INIT_TYPE_CTOR_INFO_MNA(private_builtin, zero_type_ctor_info, 0);
- MR_INIT_TYPE_CTOR_INFO_MNA(private_builtin, zero_type_info, 0);
- MR_INIT_TYPE_CTOR_INFO_MNA(private_builtin, zero_base_typeclass_info, 0);
- MR_INIT_TYPE_CTOR_INFO_MNA(private_builtin, zero_typeclass_info, 0);
MR_INIT_TYPE_CTOR_INFO_MNA(type_desc, type_ctor_desc, 0);
MR_INIT_TYPE_CTOR_INFO_MNA(type_desc, pseudo_type_desc, 0);
MR_INIT_TYPE_CTOR_INFO_MNA(type_desc, type_desc, 0);
@@ -1931,10 +1655,6 @@
MR_REGISTER_TYPE_CTOR_INFO(private_builtin, type_info, 0);
MR_REGISTER_TYPE_CTOR_INFO(private_builtin, base_typeclass_info, 0);
MR_REGISTER_TYPE_CTOR_INFO(private_builtin, typeclass_info, 0);
- MR_REGISTER_TYPE_CTOR_INFO(private_builtin, zero_type_ctor_info, 0);
- MR_REGISTER_TYPE_CTOR_INFO(private_builtin, zero_type_info, 0);
- MR_REGISTER_TYPE_CTOR_INFO(private_builtin, zero_base_typeclass_info, 0);
- MR_REGISTER_TYPE_CTOR_INFO(private_builtin, zero_typeclass_info, 0);
MR_REGISTER_TYPE_CTOR_INFO(type_desc, type_ctor_desc, 0);
MR_REGISTER_TYPE_CTOR_INFO(type_desc, pseudo_type_desc, 0);
MR_REGISTER_TYPE_CTOR_INFO(type_desc, type_desc, 0);
@@ -1971,14 +1691,6 @@
base_typeclass_info, 0);
MR_WRITE_OUT_PROC_STATIC_LAYOUTS(fp, private_builtin,
typeclass_info, 0);
- MR_WRITE_OUT_PROC_STATIC_LAYOUTS(fp, private_builtin,
- zero_type_ctor_info, 0);
- MR_WRITE_OUT_PROC_STATIC_LAYOUTS(fp, private_builtin,
- zero_type_info, 0);
- MR_WRITE_OUT_PROC_STATIC_LAYOUTS(fp, private_builtin,
- zero_base_typeclass_info, 0);
- MR_WRITE_OUT_PROC_STATIC_LAYOUTS(fp, private_builtin,
- zero_typeclass_info, 0);
MR_WRITE_OUT_PROC_STATIC_LAYOUTS(fp, type_desc, type_ctor_desc, 0);
MR_WRITE_OUT_PROC_STATIC_LAYOUTS(fp, type_desc, pseudo_type_desc, 0);
MR_WRITE_OUT_PROC_STATIC_LAYOUTS(fp, type_desc, type_desc, 0);
Index: runtime/mercury_builtin_types.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_builtin_types.h,v
retrieving revision 1.8
diff -u -b -r1.8 mercury_builtin_types.h
--- runtime/mercury_builtin_types.h 22 Sep 2005 06:17:31 -0000 1.8
+++ runtime/mercury_builtin_types.h 23 Sep 2005 03:38:49 -0000
@@ -55,14 +55,6 @@
MR_DECLARE_TYPE_CTOR_INFO_STRUCT(
MR_TYPE_CTOR_INFO_NAME(private_builtin, base_typeclass_info, 0));
MR_DECLARE_TYPE_CTOR_INFO_STRUCT(
- MR_TYPE_CTOR_INFO_NAME(private_builtin, zero_type_ctor_info, 0));
-MR_DECLARE_TYPE_CTOR_INFO_STRUCT(
- MR_TYPE_CTOR_INFO_NAME(private_builtin, zero_type_info, 0));
-MR_DECLARE_TYPE_CTOR_INFO_STRUCT(
- MR_TYPE_CTOR_INFO_NAME(private_builtin, zero_typeclass_info, 0));
-MR_DECLARE_TYPE_CTOR_INFO_STRUCT(
- MR_TYPE_CTOR_INFO_NAME(private_builtin, zero_base_typeclass_info, 0));
-MR_DECLARE_TYPE_CTOR_INFO_STRUCT(
MR_TYPE_CTOR_INFO_NAME(type_desc, type_ctor_desc, 0));
MR_DECLARE_TYPE_CTOR_INFO_STRUCT(
MR_TYPE_CTOR_INFO_NAME(type_desc, pseudo_type_desc, 0));
@@ -108,14 +100,6 @@
MR_Mercury_TypeClass_Info x, MR_Mercury_TypeClass_Info y);
MR_bool MR_CALL mercury__private_builtin____Unify____base_typeclass_info_0_0(
MR_Mercury_Base_TypeClass_Info x, MR_Mercury_Base_TypeClass_Info y);
-MR_bool MR_CALL mercury__private_builtin____Unify____zero_type_ctor_info_0_0(
- MR_Mercury_Type_Ctor_Info x, MR_Mercury_Type_Ctor_Info y);
-MR_bool MR_CALL mercury__private_builtin____Unify____zero_type_info_0_0(
- MR_Mercury_Type_Info x, MR_Mercury_Type_Info y);
-MR_bool MR_CALL mercury__private_builtin____Unify____zero_typeclass_info_0_0(
- MR_Mercury_TypeClass_Info x, MR_Mercury_TypeClass_Info y);
-MR_bool MR_CALL mercury__private_builtin____Unify____zero_base_typeclass_info_0_0(
- MR_Mercury_Base_TypeClass_Info x, MR_Mercury_Base_TypeClass_Info y);
void MR_CALL mercury__builtin____Compare____int_0_0(
MR_Comparison_Result *result, MR_Integer x, MR_Integer y);
@@ -158,18 +142,6 @@
MR_Comparison_Result *result,
MR_Mercury_TypeClass_Info x, MR_Mercury_TypeClass_Info y);
void MR_CALL mercury__private_builtin____Compare____base_typeclass_info_0_0(
- MR_Comparison_Result *result,
- MR_Mercury_Base_TypeClass_Info x, MR_Mercury_Base_TypeClass_Info y);
-void MR_CALL mercury__private_builtin____Compare____zero_type_ctor_info_0_0(
- MR_Comparison_Result *result,
- MR_Mercury_Type_Ctor_Info x, MR_Mercury_Type_Ctor_Info y);
-void MR_CALL mercury__private_builtin____Compare____zero_type_info_0_0(
- MR_Comparison_Result *result,
- MR_Mercury_Type_Info x, MR_Mercury_Type_Info y);
-void MR_CALL mercury__private_builtin____Compare____zero_typeclass_info_0_0(
- MR_Comparison_Result *result,
- MR_Mercury_TypeClass_Info x, MR_Mercury_TypeClass_Info y);
-void MR_CALL mercury__private_builtin____Compare____zero_base_typeclass_info_0_0(
MR_Comparison_Result *result,
MR_Mercury_Base_TypeClass_Info x, MR_Mercury_Base_TypeClass_Info y);
Index: runtime/mercury_grade.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_grade.h,v
retrieving revision 1.61
diff -u -b -r1.61 mercury_grade.h
--- runtime/mercury_grade.h 13 Sep 2005 08:25:38 -0000 1.61
+++ runtime/mercury_grade.h 23 Sep 2005 03:46:10 -0000
@@ -60,7 +60,7 @@
** compatibility only in debugging and deep profiling grades respectively.
*/
-#define MR_GRADE_PART_0 v13_
+#define MR_GRADE_PART_0 v14_
#define MR_GRADE_EXEC_TRACE_VERSION_NO 4
#define MR_GRADE_DEEP_PROF_VERSION_NO 1
Index: runtime/mercury_make_type_info_body.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_make_type_info_body.h,v
retrieving revision 1.13
diff -u -b -r1.13 mercury_make_type_info_body.h
--- runtime/mercury_make_type_info_body.h 14 Dec 2004 01:07:24 -0000 1.13
+++ runtime/mercury_make_type_info_body.h 23 Sep 2005 03:35:02 -0000
@@ -88,25 +88,6 @@
#endif
}
- if (MR_type_ctor_is_typeinfo_fake_arity(type_ctor_info)) {
- /*
- ** These types have to be treated specially, because their
- ** arity is a lie. They do not actually take a type as an
- ** argument, and looking for the typeinfo of that nonexistent
- ** type can lead to core dumps.
- **
- ** The proper fix would be to avoid making their arities lie.
- ** We use void as a space filler until that can be done.
- */
-
- ALLOCATE_WORDS(type_info_arena_word, 2);
- type_info_arena = (MR_Word *) type_info_arena_word;
- type_info_arena[0] = (MR_Word) type_ctor_info;
- type_info_arena[1] = (MR_Word)
- &MR_TYPE_CTOR_INFO_NAME(builtin, void, 0);
- return (return_type) type_info_arena;
- }
-
if (MR_type_ctor_has_variable_arity(type_ctor_info)) {
arity = MR_PSEUDO_TYPEINFO_GET_VAR_ARITY_ARITY(pseudo_type_info);
start_region_size = 2;
Index: runtime/mercury_type_info.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_type_info.h,v
retrieving revision 1.116
diff -u -b -r1.116 mercury_type_info.h
--- runtime/mercury_type_info.h 15 Dec 2004 02:30:34 -0000 1.116
+++ runtime/mercury_type_info.h 23 Sep 2005 03:46:37 -0000
@@ -75,7 +75,7 @@
** compiler/type_ctor_info.m and with MR_RTTI_VERSION in mercury_mcpp.h.
*/
-#define MR_RTTI_VERSION MR_RTTI_VERSION__STABLE_FOREIGN
+#define MR_RTTI_VERSION MR_RTTI_VERSION__TYPE_INFO_ZERO
#define MR_RTTI_VERSION__INITIAL 2
#define MR_RTTI_VERSION__USEREQ 3
#define MR_RTTI_VERSION__CLEAN_LAYOUT 4
@@ -84,6 +84,7 @@
#define MR_RTTI_VERSION__REP 7
#define MR_RTTI_VERSION__FLAG 8
#define MR_RTTI_VERSION__STABLE_FOREIGN 9
+#define MR_RTTI_VERSION__TYPE_INFO_ZERO 10
/*
** Check that the RTTI version is in a sensible range.
@@ -91,10 +92,15 @@
** number. The upper bound is the current version number.
** If you increase the lower bound you should also increase the binary
** compatibility version number in runtime/mercury_grade.h (MR_GRADE_PART_0).
+**
+** Note that the definition of this macro matters only if it used, and (for
+** efficiency) it shouldn't be used except if a period of transition between
+** different versions requires different treatment of RTTI structures generated
+** by different compiler versions.
*/
#define MR_TYPE_CTOR_INFO_CHECK_RTTI_VERSION_RANGE(typector) \
- assert(typector->MR_type_ctor_version == MR_RTTI_VERSION__FLAG)
+ assert(typector->MR_type_ctor_version == MR_RTTI_VERSION__TYPE_INFO_ZERO)
/*---------------------------------------------------------------------------*/
@@ -1220,7 +1226,6 @@
#define MR_TYPE_CTOR_FLAG_RESERVE_TAG 0x1
#define MR_TYPE_CTOR_FLAG_VARIABLE_ARITY 0x2
#define MR_TYPE_CTOR_FLAG_KIND_OF_DU 0x4
-#define MR_TYPE_CTOR_FLAG_TYPEINFO_FAKE_ARITY 0x8
#define MR_type_ctor_has_reserve_tag(tci) \
((tci)->MR_type_ctor_flags & MR_TYPE_CTOR_FLAG_RESERVE_TAG)
@@ -1228,8 +1233,6 @@
((tci)->MR_type_ctor_flags & MR_TYPE_CTOR_FLAG_VARIABLE_ARITY)
#define MR_type_ctor_is_kind_of_du(tci) \
((tci)->MR_type_ctor_flags & MR_TYPE_CTOR_FLAG_KIND_OF_DU)
-#define MR_type_ctor_is_typeinfo_fake_arity(tci) \
- ((tci)->MR_type_ctor_flags & MR_TYPE_CTOR_FLAG_TYPEINFO_FAKE_ARITY)
/*---------------------------------------------------------------------------*/
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing slice
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
Index: trace/mercury_trace_vars.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_vars.c,v
retrieving revision 1.66
diff -u -b -r1.66 mercury_trace_vars.c
--- trace/mercury_trace_vars.c 22 Sep 2005 06:17:33 -0000 1.66
+++ trace/mercury_trace_vars.c 23 Sep 2005 04:07:01 -0000
@@ -171,14 +171,6 @@
extern const struct MR_TypeCtorInfo_Struct
MR_TYPE_CTOR_INFO_NAME(private_builtin, base_typeclass_info, 0);
extern const struct MR_TypeCtorInfo_Struct
- MR_TYPE_CTOR_INFO_NAME(private_builtin, zero_type_info, 0);
-extern const struct MR_TypeCtorInfo_Struct
- MR_TYPE_CTOR_INFO_NAME(private_builtin, zero_type_ctor_info, 0);
-extern const struct MR_TypeCtorInfo_Struct
- MR_TYPE_CTOR_INFO_NAME(private_builtin, zero_typeclass_info, 0);
-extern const struct MR_TypeCtorInfo_Struct
- MR_TYPE_CTOR_INFO_NAME(private_builtin, zero_base_typeclass_info, 0);
-extern const struct MR_TypeCtorInfo_Struct
MR_TYPE_CTOR_INFO_NAME(std_util, type_desc, 0);
extern const struct MR_TypeCtorInfo_Struct
MR_TYPE_CTOR_INFO_NAME(std_util, type_ctor_desc, 0);
@@ -215,8 +207,6 @@
/* or their definitions are updated. XXX */
&MR_TYPE_CTOR_INFO_NAME(private_builtin, typeclass_info, 0),
&MR_TYPE_CTOR_INFO_NAME(private_builtin, base_typeclass_info, 0),
- &MR_TYPE_CTOR_INFO_NAME(private_builtin, zero_typeclass_info, 0),
- &MR_TYPE_CTOR_INFO_NAME(private_builtin, zero_base_typeclass_info, 0),
/* we ignore these because they should never be needed */
&MR_TYPE_CTOR_INFO_NAME(builtin, void, 0),
@@ -243,8 +233,6 @@
*/
&MR_TYPE_CTOR_INFO_NAME(private_builtin, type_info, 0),
&MR_TYPE_CTOR_INFO_NAME(private_builtin, type_ctor_info, 0),
- &MR_TYPE_CTOR_INFO_NAME(private_builtin, zero_type_info, 0),
- &MR_TYPE_CTOR_INFO_NAME(private_builtin, zero_type_ctor_info, 0),
/* dummy member */
NULL
};
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
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