for review: rename base_type_* to type_ctor_* (part 1/2)
Tyson Dowd
trd at cs.mu.OZ.AU
Wed Mar 17 14:41:24 AEDT 1999
Hi,
This change may cause some disruption. If you are working on
code affected by this change you may want to use the sed scripts
below to make renaming easier.
The change is very long and boring.
===================================================================
Estimated hours taken: 8
During the writing of the RTTI paper, we decided that type_ctor_info
was a much better name than base_type_info.
Rename base_type* as type_ctor*, except we don't rename the modules
base_type_info and base_type_layout just yet. Also base_typeclass_info
remains the same because nobody has suggested a better name for it.
Most of these changes were made using the following sed patterns:
s/base_type_info/type_ctor_info/g
s/base_type_layout/type_ctor_layout/g
s/base_type_functors/type_ctor_functors/g
s/BASETYPE_INFO/TYPE_CTOR_INFO/g
s/TYPEFUNCTORS/TYPE_CTOR_FUNCTORS/g
s/TYPELAYOUT/TYPE_CTOR_LAYOUT/g
s/BASE_TYPEINFO/TYPE_CTOR_INFO/g
s/BASE_TYPE_INFO/TYPE_CTOR_INFO/g
s/BaseTypeInfo/TypeCtorInfo/g
s/BaseTypeLayout/TypeCtorLayout/g
s/base_type(/type_ctor(/g
s/:- module type_ctor_info/:- module base_type_info/g
s/:- module type_ctor_layout/:- module base_type_layout/g
s/type_ctor_info__/base_type_info__/g
s/type_ctor_layout__/base_type_layout__/g
runtime/mercury_bootstrap.h:
Add bootstrapping #defines so the type_ctor_* substitutions in
the library don't cause link problems.
Index: compiler/base_type_info.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/base_type_info.m,v
retrieving revision 1.21
diff -u -r1.21 base_type_info.m
--- base_type_info.m 1998/11/19 06:13:19 1.21
+++ base_type_info.m 1999/03/15 12:26:49
@@ -5,7 +5,7 @@
%---------------------------------------------------------------------------%
%
% This module generates the LLDS code that defines global variables
-% to hold the base_type_info structures of the types defined by the
+% to hold the type_ctor_info structures of the types defined by the
% current module.
%
% These global variables are needed only with when we are using the
@@ -15,7 +15,7 @@
% compilation time and executable size.)
%
% See polymorphism.m for a description of the various ways to represent
-% type information, including a description of the base_type_info structures.
+% type information, including a description of the type_ctor_info structures.
%
% Author: zs.
%
@@ -104,7 +104,7 @@
;
SymName = unqualified(TypeName),
string__append_list(["unqualified type ", TypeName,
- "found in base_type_info"], Msg),
+ "found in type_ctor_info"], Msg),
error(Msg)
).
@@ -124,18 +124,18 @@
base_type_info__generate_llds(ModuleInfo, CModules) :-
module_info_base_gen_infos(ModuleInfo, BaseGenInfos),
- base_type_info__construct_base_type_infos(BaseGenInfos, ModuleInfo,
+ base_type_info__construct_type_ctor_infos(BaseGenInfos, ModuleInfo,
CModules1),
base_typeclass_info__generate_llds(ModuleInfo, CModules2),
% XXX make this use an accumulator
list__append(CModules1, CModules2, CModules).
-:- pred base_type_info__construct_base_type_infos(list(base_gen_info),
+:- pred base_type_info__construct_type_ctor_infos(list(base_gen_info),
module_info, list(comp_gen_c_data)).
-:- mode base_type_info__construct_base_type_infos(in, in, out) is det.
+:- mode base_type_info__construct_type_ctor_infos(in, in, out) is det.
-base_type_info__construct_base_type_infos([], _, []).
-base_type_info__construct_base_type_infos([BaseGenInfo | BaseGenInfos],
+base_type_info__construct_type_ctor_infos([], _, []).
+base_type_info__construct_type_ctor_infos([BaseGenInfo | BaseGenInfos],
ModuleInfo, [CModule | CModules]) :-
BaseGenInfo = base_gen_info(_TypeId, ModuleName, TypeName, TypeArity,
_Status, Elim, Procs),
@@ -144,7 +144,7 @@
ArityArg = yes(const(int_const(TypeArity))),
/******
-It would be more efficient if we could make base_type_infos local,
+It would be more efficient if we could make type_ctor_infos local,
but linkage/2 in llds_out.m requires that we make them all exported
if any of them are exported, so that we can compute the linkage
from the data_name, for use in forward declarations.
@@ -169,10 +169,10 @@
;
FinalArgs = PredAddrArgs
),
- DataName = base_type(info, TypeName, TypeArity),
+ DataName = type_ctor(info, TypeName, TypeArity),
CModule = comp_gen_c_data(ModuleName, DataName, Exported,
[ArityArg | FinalArgs], Procs),
- base_type_info__construct_base_type_infos(BaseGenInfos, ModuleInfo,
+ base_type_info__construct_type_ctor_infos(BaseGenInfos, ModuleInfo,
CModules).
:- pred base_type_info__construct_layout(module_info, string, int, maybe(rval)).
@@ -180,7 +180,7 @@
base_type_info__construct_layout(ModuleInfo, TypeName, TypeArity, Rval) :-
module_info_name(ModuleInfo, ModuleName),
Rval = yes(const(data_addr_const(data_addr(ModuleName,
- base_type(layout, TypeName, TypeArity))))).
+ type_ctor(layout, TypeName, TypeArity))))).
:- pred base_type_info__construct_functors(module_info, string, int,
maybe(rval)).
@@ -188,7 +188,7 @@
base_type_info__construct_functors(ModuleInfo, TypeName, TypeArity, Rval) :-
module_info_name(ModuleInfo, ModuleName),
Rval = yes(const(data_addr_const(data_addr(ModuleName,
- base_type(functors, TypeName, TypeArity))))).
+ type_ctor(functors, TypeName, TypeArity))))).
:- pred base_type_info__construct_pred_addrs(list(pred_proc_id), maybe(int),
module_info, list(maybe(rval))).
Index: compiler/base_type_layout.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/base_type_layout.m,v
retrieving revision 1.38
diff -u -r1.38 base_type_layout.m
--- base_type_layout.m 1998/11/24 03:56:54 1.38
+++ base_type_layout.m 1999/03/15 12:26:49
@@ -5,7 +5,7 @@
%---------------------------------------------------------------------------%
%
% This module generates the LLDS code that defines global constants
-% to hold the `base_type_layout' and `base_type_functors' structures
+% to hold the `type_ctor_layout' and `type_ctor_functors' structures
% of the types defined by the current module.
%
% It requires that type_infos are generated using the
@@ -24,7 +24,7 @@
%
%---------------------------------------------------------------------------%
%
-% NOTE: If the representation of base_type_layouts changes, the
+% NOTE: If the representation of type_ctor_layouts changes, the
% following modules must also be examined to see whether they need to
% be updated.
%
@@ -38,7 +38,7 @@
% mercury_deep_copy.{c,h} - deep_copy
% mercury_table_any.c - tabling
%
-% Any module that uses base_type_layouts should register itself here.
+% Any module that uses type_ctor_layouts should register itself here.
% Changes can by minimized by using the macros in type_info.h.
%
%---------------------------------------------------------------------------%
@@ -110,7 +110,7 @@
% SIMPLE above.
%
% Tag 3 - VAR/EQ Word = type variable number, or pointer to
-% indicator, equivalent base_type_info
+% indicator, equivalent type_ctor_info
% and maybe functor.
%
% VAR/EQ: There are 3 cases covered by this tag, all of them forms
@@ -162,9 +162,9 @@
%
% Data representation: Functors Tables
%
-% base_type_functors tables are generated, one for each type. These
+% type_ctor_functors tables are generated, one for each type. These
% contain information about the functors of discriminated union (du)
-% types. The same information is available in the base_type_layouts, but
+% types. The same information is available in the type_ctor_layouts, but
% is quite difficult to obtain, because the functors tables are designed
% for easy indexing via primary and secondary tag.
%
@@ -193,17 +193,17 @@
%
% Note: Future Work
%
-% Because the indicator in the base_type_functors duplicates
-% information present in the base_type_layouts, it would be good
-% to simplify the encoding of base_type_layouts by removing the
+% Because the indicator in the type_ctor_functors duplicates
+% information present in the type_ctor_layouts, it would be good
+% to simplify the encoding of type_ctor_layouts by removing the
% redundant information. For example:
%
% - You don't need any information about equivalences,
-% no_tag types, or enumerations in the base_type_layouts,
+% no_tag types, or enumerations in the type_ctor_layouts,
% since the same information is already in the
-% base_type_functors.
+% type_ctor_functors.
% - If you add a little more information about specials
-% to the base_type_functors, you would no longer need the
+% to the type_ctor_functors, you would no longer need the
% information in the layout tables (eg, is it an int, a float,
% etc).
%
@@ -309,7 +309,7 @@
SymName = unqualified(TypeName),
string__append_list(["unqualified type ", TypeName,
- "found in base_type_layout"], Msg),
+ "found in type_ctor_layout"], Msg),
error(Msg)
).
@@ -352,7 +352,7 @@
hlds_data__get_type_defn_body(HldsType, TypeBody),
(
TypeBody = uu_type(_Alts),
- error("base_type_layout: sorry, undiscriminated union unimplemented\n")
+ error("type_ctor_layout: sorry, undiscriminated union unimplemented\n")
;
TypeBody = eqv_type(Type),
base_type_layout__layout_eqv(Type, LayoutInfo1,
@@ -404,11 +404,11 @@
),
%
- % Note: base_type_layouts and base_type_functors are never exported,
- % because they should only be accessed via the base_type_info in
+ % Note: type_ctor_layouts and type_ctor_functors are never exported,
+ % because they should only be accessed via the type_ctor_info in
% the same module.
- % Accesses to the base_type_layout for a type exported from a
- % different module should be done via that type's base_type_info,
+ % Accesses to the type_ctor_layout for a type exported from a
+ % different module should be done via that type's type_ctor_info,
% which will be exported if the type was exported/abstract_exported.
%
Exported = no,
@@ -419,10 +419,10 @@
->
LayoutInfo5 = LayoutInfo3
;
- LayoutDataName = base_type(layout, TypeName, TypeArity),
+ LayoutDataName = type_ctor(layout, TypeName, TypeArity),
LayoutCData = comp_gen_c_data(ModuleName, LayoutDataName,
Exported, LayoutTypeData, []),
- FunctorsDataName = base_type(functors, TypeName, TypeArity),
+ FunctorsDataName = type_ctor(functors, TypeName, TypeArity),
FunctorsCData = comp_gen_c_data(ModuleName, FunctorsDataName,
Exported, FunctorsTypeData, []),
base_type_layout__add_c_data(LayoutInfo3, LayoutCData,
@@ -490,7 +490,7 @@
:- pred base_type_layout__tag_value_equiv(int::out) is det.
base_type_layout__tag_value_equiv(3).
- % Constants for base_type_functors
+ % Constants for type_ctor_functors
:- type functors_category ---> du
; enum
@@ -567,7 +567,7 @@
SecTag = SecTag0, Tag = Tag0
;
error(
- "base_type_layout: cons_tag not simple or complicated in du")
+ "type_ctor_layout: cons_tag not simple or complicated in du")
),
base_type_layout__encode_mkword(LayoutInfo, Tag,
const(int_const(SecTag)), ConsTagRval).
@@ -600,13 +600,13 @@
const(int_const(Value)), Rval)
;
ConsTag = pred_closure_tag(_, _),
- error("base_type_layout: Unexpected tag - pred_closure_tag/2")
+ error("type_ctor_layout: Unexpected tag - pred_closure_tag/2")
;
ConsTag = code_addr_constant(_, _),
- error("base_type_layout: Unexpected constant - code_addr_constant/2")
+ error("type_ctor_layout: Unexpected constant - code_addr_constant/2")
;
- ConsTag = base_type_info_constant(_, _, _),
- error("base_type_layout: Unexpected constant - base_type_into_constant/3")
+ ConsTag = type_ctor_info_constant(_, _, _),
+ error("type_ctor_layout: Unexpected constant - base_type_into_constant/3")
),
list__duplicate(MaxTags, Rval, RvalsList),
list__condense(RvalsList, Rvals).
@@ -651,7 +651,7 @@
unqualify_name(SymName, CtorName),
CtorRval = yes(const(string_const(CtorName)))
;
- error("base_type_layout: constant has no constructor")
+ error("type_ctor_layout: constant has no constructor")
)
)),
ConsList, CtorNameRvals),
@@ -769,7 +769,7 @@
layout_info, layout_info, list(maybe(rval))).
:- mode base_type_layout__layout_du(in, in, out, out) is det.
base_type_layout__layout_du([], _, _, []) :-
- error("base_type_layout: type with no cons_tag information").
+ error("type_ctor_layout: type with no cons_tag information").
base_type_layout__layout_du(ConsList, LayoutInfo0, LayoutInfo, Rvals) :-
ConsList = [ConsPair | _],
base_type_layout__get_max_tags(LayoutInfo0, MaxTags),
@@ -815,7 +815,7 @@
list__append(Rval, Rvals0, Rvals1)
;
Tag = no_tag,
- error("base_type_layout: unexpected no_tag")
+ error("type_ctor_layout: unexpected no_tag")
;
Tag = unused,
LayoutInfo1 = LayoutInfo0,
@@ -841,7 +841,7 @@
:- mode base_type_layout__handle_comp_const(in, in, out, out) is det.
base_type_layout__handle_comp_const([], _, _, _) :-
- error("base_type_layout: no constructors for complicated constant tag").
+ error("type_ctor_layout: no constructors for complicated constant tag").
base_type_layout__handle_comp_const([C | Cs], LayoutInfo0, LayoutInfo, Rval) :-
list__length([C | Cs], NumCtors), % Number of sharers
Rval1 = yes(const(int_const(NumCtors))),
@@ -855,7 +855,7 @@
unqualify_name(SymName, CtorName),
CtorRval = yes(const(string_const(CtorName)))
;
- error("base_type_layout: constant has no constructor")
+ error("type_ctor_layout: constant has no constructor")
))),
[C | Cs], CtorNameRvals),
@@ -895,7 +895,7 @@
:- mode base_type_layout__simple_vector(in, in, out, out) is det.
base_type_layout__simple_vector([], _, _, _) :-
- error("base_type_layout: no constructors for simple tag").
+ error("type_ctor_layout: no constructors for simple tag").
base_type_layout__simple_vector([ConsId - ConsTag | _], LayoutInfo0,
LayoutInfo, EndRvals) :-
(
@@ -903,7 +903,7 @@
->
unqualify_name(SymName, ConsString)
;
- error("base_type_layout: simple tag with no constructor")
+ error("type_ctor_layout: simple tag with no constructor")
),
base_type_layout__get_cons_args(LayoutInfo0, ConsId, ConsArgs),
list__length(ConsArgs, NumArgs),
@@ -928,7 +928,7 @@
:- mode base_type_layout__handle_complicated(in, in, out, out) is det.
base_type_layout__handle_complicated([], _, _, _) :-
- error("base_type_layout: no constructors for complicated tag").
+ error("type_ctor_layout: no constructors for complicated tag").
base_type_layout__handle_complicated([C | Cs], LayoutInfo0, LayoutInfo, Rval) :-
base_type_layout__get_next_cell_number(NextCellNumber, LayoutInfo0,
LayoutInfo1),
@@ -956,10 +956,10 @@
%---------------------------------------------------------------------------%
- % Code to create the contents of base_type_functors.
+ % Code to create the contents of type_ctor_functors.
- % base_type_functors of an equivalence type:
+ % type_ctor_functors of an equivalence type:
%
% - equivalence indicator
% - pointer to equivalent pseudo_type_info
@@ -977,7 +977,7 @@
EqvRval = yes(const(int_const(EqvIndicator))),
Rvals = [EqvRval, Rvals0].
- % base_type_functors of an enumeration:
+ % type_ctor_functors of an enumeration:
%
% - enumeration indicator
% - pointer to enumeration vector
@@ -1000,11 +1000,11 @@
"type_layout")),
Rvals = [EnumRval, CreateRval].
- % base_type_functors of a no_tag:
+ % type_ctor_functors of a no_tag:
%
% - no_tag indicator
% - pointer to simple vector (same as for simple tag functors
- % in base_type_layouts).
+ % in type_ctor_layouts).
% (the simple vector describes the functor).
:- pred base_type_layout__functors_no_tag(sym_name, type, layout_info,
@@ -1026,12 +1026,12 @@
Rvals = [NoTagRval, CreateRval].
- % base_type_functors of a du:
+ % type_ctor_functors of a du:
%
% - du indicator
% - number of functors
% - vector of pointers to simple vector (same as for simple tag
- % functors in base_type_layouts).
+ % functors in type_ctor_layouts).
% (each simple vector describes a functor).
:- pred base_type_layout__functors_du(assoc_list(cons_id, cons_tag),
@@ -1056,7 +1056,7 @@
ConsList, [] - LayoutInfo0, VectorRvals - LayoutInfo),
Rvals = [DuIndicatorRval, LengthRval | VectorRvals].
- % base_type_functors of a special:
+ % type_ctor_functors of a special:
%
% - special indicator
@@ -1106,7 +1106,7 @@
),
(
% For higher order types: they all refer to the
- % defined pred_0 base_type_info, have an extra
+ % defined pred_0 type_ctor_info, have an extra
% argument for their real arity, and then type
% arguments according to their types.
% polymorphism.m has a detailed explanation.
@@ -1126,7 +1126,7 @@
RealArityArg = []
),
Pseudo0 = yes(const(data_addr_const(data_addr(TypeModule,
- base_type(info, TypeName, Arity))))),
+ type_ctor(info, TypeName, Arity))))),
CNum1 = CNum0 + 1,
% generate args, but remove one level of create()s.
@@ -1145,11 +1145,11 @@
term__var_to_int(Var, VarInt),
base_type_layout__max_varint(MaxVarInt),
require(VarInt < MaxVarInt,
- "base_type_layout: type variable representation exceeds limit"),
+ "type_ctor_layout: type variable representation exceeds limit"),
Pseudo = const(int_const(VarInt)),
CNum = CNum0
;
- error("base_type_layout: type neither var nor non-var")
+ error("type_ctor_layout: type neither var nor non-var")
).
@@ -1225,7 +1225,7 @@
base_type_layout__tag_type_and_value(int_constant(_), -1, unused).
base_type_layout__tag_type_and_value(pred_closure_tag(_, _), -1, unused).
base_type_layout__tag_type_and_value(code_addr_constant(_, _), -1, unused).
-base_type_layout__tag_type_and_value(base_type_info_constant(_, _, _), -1,
+base_type_layout__tag_type_and_value(type_ctor_info_constant(_, _, _), -1,
unused).
base_type_layout__tag_type_and_value(base_typeclass_info_constant(_, _, _), -1,
unused).
@@ -1249,12 +1249,12 @@
->
TypeArgs = TypeArgs0
;
- error("base_type_layout: no matching cons definition")
+ error("type_ctor_layout: no matching cons definition")
).
%---------------------------------------------------------------------------%
- % access to the base_type_layout data structure.
+ % access to the type_ctor_layout data structure.
:- pred base_type_layout__get_module_name(layout_info, module_name).
:- mode base_type_layout__get_module_name(in, out) is det.
Index: compiler/bytecode.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/bytecode.m,v
retrieving revision 1.36
diff -u -r1.36 bytecode.m
--- bytecode.m 1999/03/08 06:09:37 1.36
+++ bytecode.m 1999/03/15 12:26:50
@@ -80,7 +80,7 @@
arity, byte_proc_id)
; code_addr_const(byte_module_id, byte_pred_id,
arity, byte_proc_id)
- ; base_type_info_const(byte_module_id, string,
+ ; type_ctor_info_const(byte_module_id, string,
int)
; base_typeclass_info_const(byte_module_id,
class_id, string)
@@ -718,7 +718,7 @@
output_pred_id(PredId),
output_length(Arity),
output_proc_id(ProcId).
-output_cons_id(base_type_info_const(ModuleId, TypeName, TypeArity)) -->
+output_cons_id(type_ctor_info_const(ModuleId, TypeName, TypeArity)) -->
output_byte(6),
output_module_id(ModuleId),
output_string(TypeName),
@@ -763,8 +763,8 @@
debug_pred_id(PredId),
debug_length(Arity),
debug_proc_id(ProcId).
-debug_cons_id(base_type_info_const(ModuleId, TypeName, TypeArity)) -->
- debug_string("base_type_info_const"),
+debug_cons_id(type_ctor_info_const(ModuleId, TypeName, TypeArity)) -->
+ debug_string("type_ctor_info_const"),
debug_module_id(ModuleId),
debug_string(TypeName),
debug_int(TypeArity).
Index: compiler/bytecode_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/bytecode_gen.m,v
retrieving revision 1.40
diff -u -r1.40 bytecode_gen.m
--- bytecode_gen.m 1998/11/24 03:56:55 1.40
+++ bytecode_gen.m 1999/03/15 12:26:51
@@ -624,8 +624,8 @@
ByteConsId = code_addr_const(ModuleName, PredName, Arity,
ProcInt)
;
- ConsId = base_type_info_const(ModuleName, TypeName, TypeArity),
- ByteConsId = base_type_info_const(ModuleName, TypeName,
+ ConsId = type_ctor_info_const(ModuleName, TypeName, TypeArity),
+ ByteConsId = type_ctor_info_const(ModuleName, TypeName,
TypeArity)
;
ConsId = base_typeclass_info_const(ModuleName, ClassId,
@@ -654,8 +654,8 @@
error("pred_closure_tag cons tag for non-pred_const cons id").
bytecode_gen__map_cons_tag(code_addr_constant(_, _), _) :-
error("code_addr_constant cons tag for non-address_const cons id").
-bytecode_gen__map_cons_tag(base_type_info_constant(_, _, _), _) :-
- error("base_type_info_constant cons tag for non-base_type_info_constant cons id").
+bytecode_gen__map_cons_tag(type_ctor_info_constant(_, _, _), _) :-
+ error("type_ctor_info_constant cons tag for non-type_ctor_info_constant cons id").
bytecode_gen__map_cons_tag(base_typeclass_info_constant(_, _, _), _) :-
error("base_typeclass_info_constant cons tag for non-base_typeclass_info_constant cons id").
bytecode_gen__map_cons_tag(tabling_pointer_constant(_, _), _) :-
Index: compiler/code_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/code_util.m,v
retrieving revision 1.104
diff -u -r1.104 code_util.m
--- code_util.m 1998/11/24 03:56:57 1.104
+++ code_util.m 1999/03/15 12:26:54
@@ -665,8 +665,8 @@
code_util__cons_id_to_tag(string_const(X), _, _, string_constant(X)).
code_util__cons_id_to_tag(code_addr_const(P,M), _, _, code_addr_constant(P,M)).
code_util__cons_id_to_tag(pred_const(P,M), _, _, pred_closure_tag(P,M)).
-code_util__cons_id_to_tag(base_type_info_const(M,T,A), _, _,
- base_type_info_constant(M,T,A)).
+code_util__cons_id_to_tag(type_ctor_info_const(M,T,A), _, _,
+ type_ctor_info_constant(M,T,A)).
code_util__cons_id_to_tag(base_typeclass_info_const(M,C,_,N), _, _,
base_typeclass_info_constant(M,C,N)).
code_util__cons_id_to_tag(tabling_pointer_const(PredId,ProcId), _, _,
Index: compiler/dead_proc_elim.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/dead_proc_elim.m,v
retrieving revision 1.43
diff -u -r1.43 dead_proc_elim.m
--- dead_proc_elim.m 1998/11/02 09:48:58 1.43
+++ dead_proc_elim.m 1999/03/15 12:26:56
@@ -183,15 +183,15 @@
%
% We need to do more thorough analysis of the
% reachability of the special predicates, in general,
- % because using arg/3 allows us to get at base_type_info
- % via the base_type_layout. The base_type_infos of
+ % because using arg/3 allows us to get at type_ctor_info
+ % via the type_ctor_layout. The type_ctor_infos of
% arguments of functors may have had their special preds
% eliminated, but they can still be called. In addition,
% it would be nice for pragma C code to have some
% support for using compiler generated data structures
% and preds, so that they aren't just eliminated.
%
- % So presently, all base_type_infos will be treated
+ % So presently, all type_ctor_infos will be treated
% as exported, and hence no special preds will be
% eliminated.
semidet_succeed
@@ -477,7 +477,7 @@
ConsId = code_addr_const(PredId, ProcId),
Entity = proc(PredId, ProcId)
;
- ConsId = base_type_info_const(Module, TypeName, Arity),
+ ConsId = type_ctor_info_const(Module, TypeName, Arity),
Entity = base_gen_info(Module, TypeName, Arity)
)
->
Index: compiler/dependency_graph.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/dependency_graph.m,v
retrieving revision 1.39
diff -u -r1.39 dependency_graph.m
--- dependency_graph.m 1998/12/06 23:43:04 1.39
+++ dependency_graph.m 1999/03/15 12:26:58
@@ -340,7 +340,7 @@
;
DepGraph = DepGraph0
).
-dependency_graph__add_arcs_in_cons(base_type_info_const(_, _, _), _Caller,
+dependency_graph__add_arcs_in_cons(type_ctor_info_const(_, _, _), _Caller,
DepGraph, DepGraph).
dependency_graph__add_arcs_in_cons(base_typeclass_info_const(_, _, _, _),
_Caller, DepGraph, DepGraph).
Index: compiler/higher_order.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/higher_order.m,v
retrieving revision 1.49
diff -u -r1.49 higher_order.m
--- higher_order.m 1998/12/06 23:43:15 1.49
+++ higher_order.m 1999/03/15 12:27:06
@@ -560,7 +560,7 @@
; Name = "typeclass_info"
).
is_interesting_cons_id(ho_params(yes, _, _), pred_const(_, _)).
-is_interesting_cons_id(ho_params(_, yes, _), base_type_info_const(_, _, _)).
+is_interesting_cons_id(ho_params(_, yes, _), type_ctor_info_const(_, _, _)).
is_interesting_cons_id(ho_params(_, yes, _),
base_typeclass_info_const(_, _, _, _)).
% We need to keep track of int_consts so we can interpret
@@ -1065,7 +1065,7 @@
( TypeArity = 0 ->
TypeInfoArgs = []
;
- TypeInfoVarArgs = [_BaseTypeInfo | TypeInfoArgs]
+ TypeInfoVarArgs = [_TypeCtorInfo | TypeInfoArgs]
),
( SpecialId = unify, type_is_atomic(SpecialPredType, ModuleInfo) ->
Index: compiler/hlds_data.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_data.m,v
retrieving revision 1.31
diff -u -r1.31 hlds_data.m
--- hlds_data.m 1999/02/12 03:46:53 1.31
+++ hlds_data.m 1999/03/15 12:27:06
@@ -34,7 +34,7 @@
% Used for constructing type_infos.
% Note that a pred_const is for a closure
% whereas a code_addr_const is just an address.
- ; base_type_info_const(module_name, string, int)
+ ; type_ctor_info_const(module_name, string, int)
% module name, type name, type arity
; base_typeclass_info_const(module_name,
class_id, int, string)
@@ -77,13 +77,13 @@
% Given a cons_id and a list of argument terms, convert it into a
% term. Fails if the cons_id is a pred_const, code_addr_const or
- % base_type_info_const.
+ % type_ctor_info_const.
:- pred cons_id_and_args_to_term(cons_id, list(term(T)), term(T)).
:- mode cons_id_and_args_to_term(in, in, out) is semidet.
% Get the arity of a cons_id, aborting on pred_const, code_addr_const
- % and base_type_info_const.
+ % and type_ctor_info_const.
:- pred cons_id_arity(cons_id, arity).
:- mode cons_id_arity(in, out) is det.
@@ -128,8 +128,8 @@
error("cons_id_arity: can't get arity of pred_const").
cons_id_arity(code_addr_const(_, _), _) :-
error("cons_id_arity: can't get arity of code_addr_const").
-cons_id_arity(base_type_info_const(_, _, _), _) :-
- error("cons_id_arity: can't get arity of base_type_info_const").
+cons_id_arity(type_ctor_info_const(_, _, _), _) :-
+ error("cons_id_arity: can't get arity of type_ctor_info_const").
cons_id_arity(base_typeclass_info_const(_, _, _, _), _) :-
error("cons_id_arity: can't get arity of base_typeclass_info_const").
cons_id_arity(tabling_pointer_const(_, _), _) :-
@@ -262,8 +262,8 @@
% (used for constructing type_infos).
% The word just contains the address of the
% specified procedure.
- ; base_type_info_constant(module_name, string, arity)
- % This is how we refer to base_type_info structures
+ ; type_ctor_info_constant(module_name, string, arity)
+ % This is how we refer to type_ctor_info structures
% represented as global data. The args are
% the name of the module the type is defined in,
% and the name of the type, and its arity.
Index: compiler/hlds_goal.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_goal.m,v
retrieving revision 1.57
diff -u -r1.57 hlds_goal.m
--- hlds_goal.m 1998/11/20 04:07:46 1.57
+++ hlds_goal.m 1999/03/15 12:27:06
@@ -226,7 +226,7 @@
% these with various special cases (construct/deconstruct/assign/
% simple_test/complicated_unify).
% The cons_id for functor/2 cannot be a pred_const, code_addr_const,
- % or base_type_info_const, since none of these can be created when
+ % or type_ctor_info_const, since none of these can be created when
% the unify_rhs field is used.
:- type unify_rhs
---> var(prog_var)
Index: compiler/hlds_module.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_module.m,v
retrieving revision 1.39
diff -u -r1.39 hlds_module.m
--- hlds_module.m 1998/12/06 23:43:17 1.39
+++ hlds_module.m 1999/03/15 12:27:07
@@ -52,7 +52,7 @@
).
% This structure contains the information we need to generate
- % a base_type_info structure for a type defined in this module.
+ % a type_ctor_info structure for a type defined in this module.
:- type base_gen_info
---> base_gen_info(
@@ -66,11 +66,11 @@
list(pred_proc_id)
% the ids of the procs
% referred to from the
- % base_type_info
+ % type_ctor_info
).
% This structure contains the information we need to generate
- % a base_type_layout structure for a type defined in this module.
+ % a type_ctor_layout structure for a type defined in this module.
:- type base_gen_layout
---> base_gen_layout(
Index: compiler/hlds_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_out.m,v
retrieving revision 1.214
diff -u -r1.214 hlds_out.m
--- hlds_out.m 1999/02/18 03:48:39 1.214
+++ hlds_out.m 1999/03/15 12:27:08
@@ -224,7 +224,7 @@
hlds_out__cons_id_to_string(float_const(_), "<float>").
hlds_out__cons_id_to_string(pred_const(_, _), "<pred>").
hlds_out__cons_id_to_string(code_addr_const(_, _), "<code_addr>").
-hlds_out__cons_id_to_string(base_type_info_const(_, _, _), "<base_type_info>").
+hlds_out__cons_id_to_string(type_ctor_info_const(_, _, _), "<type_ctor_info>").
hlds_out__cons_id_to_string(base_typeclass_info_const(_, _, _, _),
"<base_typeclass_info>").
hlds_out__cons_id_to_string(tabling_pointer_const(_, _),
@@ -246,8 +246,8 @@
io__write_string("<pred>").
hlds_out__write_cons_id(code_addr_const(_PredId, _ProcId)) -->
io__write_string("<code_addr>").
-hlds_out__write_cons_id(base_type_info_const(_, _, _)) -->
- io__write_string("<base_type_info>").
+hlds_out__write_cons_id(type_ctor_info_const(_, _, _)) -->
+ io__write_string("<type_ctor_info>").
hlds_out__write_cons_id(base_typeclass_info_const(_, _, _, _)) -->
io__write_string("<base_typeclass_info>").
hlds_out__write_cons_id(tabling_pointer_const(_, _)) -->
@@ -1585,8 +1585,8 @@
{ ConsId = code_addr_const(_, _) },
{ error("hlds_out__write_functor_cons_id: code_addr_const") }
;
- { ConsId = base_type_info_const(Module, Name, Arity) },
- io__write_string("base_type_info("""),
+ { ConsId = type_ctor_info_const(Module, Name, Arity) },
+ io__write_string("type_ctor_info("""),
prog_out__write_sym_name(Module),
io__write_string(""", """),
io__write_string(Name),
Index: compiler/llds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/llds.m,v
retrieving revision 1.235
diff -u -r1.235 llds.m
--- llds.m 1998/12/06 23:43:33 1.235
+++ llds.m 1999/03/15 12:27:14
@@ -656,7 +656,7 @@
:- type data_name
---> common(int)
- ; base_type(base_data, string, arity)
+ ; type_ctor(base_data, string, arity)
% base_data, type name, type arity
; base_typeclass_info(class_id, string)
% class name & class arity, names and arities of the
Index: compiler/llds_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/llds_out.m,v
retrieving revision 1.103
diff -u -r1.103 llds_out.m
--- llds_out.m 1999/02/04 14:58:10 1.103
+++ llds_out.m 1999/03/16 03:31:06
@@ -108,10 +108,10 @@
:- pred output_c_quoted_string(string, io__state, io__state).
:- mode output_c_quoted_string(in, di, uo) is det.
- % Create a name for base_type_*
+ % Create a name for type_ctor_*
-:- pred llds_out__make_base_type_name(base_data, string, arity, string).
-:- mode llds_out__make_base_type_name(in, in, in, out) is det.
+:- pred llds_out__make_type_ctor_name(base_data, string, arity, string).
+:- mode llds_out__make_type_ctor_name(in, in, in, out) is det.
% Create a name for base_typeclass_info
@@ -508,8 +508,8 @@
{ NextSeq is Seq + 1 },
output_init_bunch_calls(Bunches, ModuleName, InitStatus, NextSeq).
- % Output MR_INIT_BASE_TYPE_INFO(BaseTypeInfo, TypeId);
- % for each base_type_info defined in this module.
+ % Output MR_INIT_TYPE_CTOR_INFO(TypeCtorInfo, TypeId);
+ % for each type_ctor_info defined in this module.
:- pred output_c_data_init_list(list(comp_gen_c_data)::in,
io__state::di, io__state::uo) is det.
@@ -518,9 +518,9 @@
output_c_data_init_list([Data | Datas]) -->
(
{ Data = comp_gen_c_data(ModuleName, DataName, _, _, _) },
- { DataName = base_type(info, TypeName, Arity) }
+ { DataName = type_ctor(info, TypeName, Arity) }
->
- io__write_string("\t\tMR_INIT_BASE_TYPE_INFO(\n\t\t"),
+ io__write_string("\t\tMR_INIT_TYPE_CTOR_INFO(\n\t\t"),
output_data_addr(ModuleName, DataName),
io__write_string(",\n\t\t\t"),
{ llds_out__sym_name_mangle(ModuleName, ModuleNameString) },
@@ -2192,9 +2192,9 @@
:- mode data_name_would_include_code_address(in, out) is det.
data_name_would_include_code_address(common(_), no).
-data_name_would_include_code_address(base_type(info, _, _), yes).
-data_name_would_include_code_address(base_type(layout, _, _), no).
-data_name_would_include_code_address(base_type(functors, _, _), no).
+data_name_would_include_code_address(type_ctor(info, _, _), yes).
+data_name_would_include_code_address(type_ctor(layout, _, _), no).
+data_name_would_include_code_address(type_ctor(functors, _, _), no).
data_name_would_include_code_address(base_typeclass_info(_, _), yes).
data_name_would_include_code_address(proc_layout(_), yes).
data_name_would_include_code_address(internal_layout(_), no).
@@ -2533,10 +2533,10 @@
globals__io_get_globals(Globals),
- % Don't make decls of base_type_infos `const' if we
+ % Don't make decls of type_ctor_infos `const' if we
% don't have static code addresses.
(
- { VarName = base_type(info, _, _) },
+ { VarName = type_ctor(info, _, _) },
{ globals__have_static_code_addresses(Globals, no) }
->
[]
@@ -2566,9 +2566,9 @@
:- pred linkage(data_name::in, linkage::out) is det.
linkage(common(_), static).
-linkage(base_type(info, _, _), extern).
-linkage(base_type(layout, _, _), static).
-linkage(base_type(functors, _, _), static).
+linkage(type_ctor(info, _, _), extern).
+linkage(type_ctor(layout, _, _), static).
+linkage(type_ctor(functors, _, _), static).
linkage(base_typeclass_info(_, _), extern).
linkage(proc_layout(_), static).
linkage(internal_layout(_), static).
@@ -2826,9 +2826,9 @@
;
{ llds_out__sym_name_mangle(ModuleName, MangledModuleName) },
io__write_string("mercury_data_"),
- { VarName = base_type(BaseData, TypeName0, TypeArity) },
+ { VarName = type_ctor(BaseData, TypeName0, TypeArity) },
io__write_string(MangledModuleName),
- { llds_out__make_base_type_name(BaseData, TypeName0, TypeArity,
+ { llds_out__make_type_ctor_name(BaseData, TypeName0, TypeArity,
Str) },
io__write_string("__"),
io__write_string(Str)
@@ -3797,7 +3797,7 @@
%-----------------------------------------------------------------------------%
-llds_out__make_base_type_name(BaseData, TypeName0, TypeArity, Str) :-
+llds_out__make_type_ctor_name(BaseData, TypeName0, TypeArity, Str) :-
(
BaseData = info,
BaseString = "info"
@@ -3810,7 +3810,7 @@
),
llds_out__name_mangle(TypeName0, TypeName),
string__int_to_string(TypeArity, A_str),
- string__append_list(["base_type_", BaseString, "_", TypeName, "_",
+ string__append_list(["type_ctor_", BaseString, "_", TypeName, "_",
A_str], Str).
Index: compiler/magic.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/magic.m,v
retrieving revision 1.1
diff -u -r1.1 magic.m
--- magic.m 1998/12/06 23:43:39 1.1
+++ magic.m 1999/03/15 12:27:17
@@ -62,8 +62,8 @@
% V_16 = 1, % number of inputs
% V_17 = "(:I)", % input relation schema
% V_18 = 1, % number of outputs
-% TypeInfo_13 = base_type_info("", "int", 0), % input type_info
-% TypeInfo_14 = base_type_info("", "int", 0), % output type_info
+% TypeInfo_13 = type_ctor_info("", "int", 0), % input type_info
+% TypeInfo_14 = type_ctor_info("", "int", 0), % output type_info
%
% % anc__do_aditi_call has the `aditi_interface' marker,
% % which causes call_gen.m to generate it as a call
Index: compiler/make_hlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/make_hlds.m,v
retrieving revision 1.284
diff -u -r1.284 make_hlds.m
--- make_hlds.m 1999/03/10 21:26:27 1.284
+++ make_hlds.m 1999/03/15 12:27:20
@@ -652,7 +652,7 @@
{ eval_method_to_string(Type, EvalMethodS) },
io__write_string(EvalMethodS),
io__write_string(
-"' declaration requires the base_type_layout\n"),
+"' declaration requires the type_ctor_layout\n"),
prog_out__write_context(Context),
io__write_string(
" structures. Use the --type-layout flag to enable them.\n")
Index: compiler/mercury_compile.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.118
diff -u -r1.118 mercury_compile.m
--- mercury_compile.m 1999/03/05 13:09:30 1.118
+++ mercury_compile.m 1999/03/16 02:14:33
@@ -978,13 +978,13 @@
mercury_compile__maybe_termination(HLDS27, Verbose, Stats, HLDS28),
mercury_compile__maybe_dump_hlds(HLDS28, "28", "termination"), !,
- mercury_compile__maybe_base_type_infos(HLDS28, Verbose, Stats, HLDS29),
+ mercury_compile__maybe_type_ctor_infos(HLDS28, Verbose, Stats, HLDS29),
!,
- mercury_compile__maybe_dump_hlds(HLDS29, "29", "base_type_infos"), !,
+ mercury_compile__maybe_dump_hlds(HLDS29, "29", "type_ctor_infos"), !,
- mercury_compile__maybe_base_type_layouts(HLDS29, Verbose, Stats,HLDS30),
+ mercury_compile__maybe_type_ctor_layouts(HLDS29, Verbose, Stats,HLDS30),
!,
- mercury_compile__maybe_dump_hlds(HLDS30, "30", "base_type_layouts"), !,
+ mercury_compile__maybe_dump_hlds(HLDS30, "30", "type_ctor_layouts"), !,
mercury_compile__maybe_bytecodes(HLDS30, ModuleName, Verbose, Stats),
!,
@@ -1553,33 +1553,33 @@
{ HLDS = HLDS0 }
).
-:- pred mercury_compile__maybe_base_type_infos(module_info, bool, bool,
+:- pred mercury_compile__maybe_type_ctor_infos(module_info, bool, bool,
module_info, io__state, io__state).
-:- mode mercury_compile__maybe_base_type_infos(in, in, in, out, di, uo) is det.
+:- mode mercury_compile__maybe_type_ctor_infos(in, in, in, out, di, uo) is det.
-mercury_compile__maybe_base_type_infos(HLDS0, Verbose, Stats, HLDS) -->
+mercury_compile__maybe_type_ctor_infos(HLDS0, Verbose, Stats, HLDS) -->
maybe_write_string(Verbose,
- "% Generating base_type_info structures..."),
+ "% Generating type_ctor_info structures..."),
maybe_flush_output(Verbose),
{ base_type_info__generate_hlds(HLDS0, HLDS) },
maybe_write_string(Verbose, " done.\n"),
maybe_report_stats(Stats).
- % We only add base_type_layouts if shared-one-or-two-cell
+ % We only add type_ctor_layouts if shared-one-or-two-cell
% type_infos are being used (the layouts refer to the
- % base_type_infos, so will fail to link without them).
+ % type_ctor_infos, so will fail to link without them).
-:- pred mercury_compile__maybe_base_type_layouts(module_info, bool, bool,
+:- pred mercury_compile__maybe_type_ctor_layouts(module_info, bool, bool,
module_info, io__state, io__state).
-:- mode mercury_compile__maybe_base_type_layouts(in, in, in, out, di, uo) is det.
+:- mode mercury_compile__maybe_type_ctor_layouts(in, in, in, out, di, uo) is det.
-mercury_compile__maybe_base_type_layouts(HLDS0, Verbose, Stats, HLDS) -->
+mercury_compile__maybe_type_ctor_layouts(HLDS0, Verbose, Stats, HLDS) -->
globals__io_lookup_bool_option(type_layout, TypeLayoutOption),
(
{ TypeLayoutOption = yes }
->
maybe_write_string(Verbose,
- "% Generating base_type_layout structures..."),
+ "% Generating type_ctor_layout structures..."),
maybe_flush_output(Verbose),
{ base_type_layout__generate_hlds(HLDS0, HLDS) },
maybe_write_string(Verbose, " done.\n"),
@@ -1982,13 +1982,13 @@
globals__io_lookup_bool_option(verbose, Verbose),
globals__io_lookup_bool_option(statistics, Stats),
{ get_c_interface_info(HLDS, C_InterfaceInfo) },
- { base_type_info__generate_llds(HLDS0, BaseTypeInfos) },
- { base_type_layout__generate_llds(HLDS0, HLDS1, BaseTypeLayouts) },
+ { base_type_info__generate_llds(HLDS0, TypeCtorInfos) },
+ { base_type_layout__generate_llds(HLDS0, HLDS1, TypeCtorLayouts) },
{ stack_layout__generate_llds(HLDS1, HLDS,
ProcLayouts, InternalLayouts, LayoutLabels) },
- { list__append(InternalLayouts, BaseTypeLayouts, StaticData0) },
+ { list__append(InternalLayouts, TypeCtorLayouts, StaticData0) },
{ llds_common(Procs0, StaticData0, ModuleName, Procs1, StaticData) },
- { list__condense([BaseTypeInfos, ProcLayouts, StaticData], AllData) },
+ { list__condense([TypeCtorInfos, ProcLayouts, StaticData], AllData) },
{ module_info_get_global_data(HLDS1, GlobalData) },
{ global_data_get_all_proc_vars(GlobalData, GlobalVars) },
mercury_compile__construct_c_file(C_InterfaceInfo, Procs1, GlobalVars,
Index: compiler/mercury_to_mercury.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_to_mercury.m,v
retrieving revision 1.153
diff -u -r1.153 mercury_to_mercury.m
--- mercury_to_mercury.m 1999/02/14 13:02:36 1.153
+++ mercury_to_mercury.m 1999/03/15 12:27:23
@@ -1062,10 +1062,10 @@
io__write_string(", "),
io__write_int(ProcInt),
io__write_string(")>").
-mercury_output_cons_id(base_type_info_const(Module, Type, Arity), _) -->
+mercury_output_cons_id(type_ctor_info_const(Module, Type, Arity), _) -->
{ prog_out__sym_name_to_string(Module, ModuleString) },
{ string__int_to_string(Arity, ArityString) },
- io__write_strings(["<base_type_info for ",
+ io__write_strings(["<type_ctor_info for ",
ModuleString, ":", Type, "/", ArityString, ">"]).
mercury_output_cons_id(
base_typeclass_info_const(Module, Class, _, InstanceString),
Index: compiler/opt_debug.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/opt_debug.m,v
retrieving revision 1.88
diff -u -r1.88 opt_debug.m
--- opt_debug.m 1998/12/06 23:44:01 1.88
+++ opt_debug.m 1999/03/16 03:07:58
@@ -702,8 +702,8 @@
opt_debug__dump_data_name(common(N), Str) :-
string__int_to_string(N, N_str),
string__append("common", N_str, Str).
-opt_debug__dump_data_name(base_type(BaseData, TypeName, TypeArity), Str) :-
- llds_out__make_base_type_name(BaseData, TypeName, TypeArity, Str).
+opt_debug__dump_data_name(type_ctor(BaseData, TypeName, TypeArity), Str) :-
+ llds_out__make_type_ctor_name(BaseData, TypeName, TypeArity, Str).
opt_debug__dump_data_name(base_typeclass_info(ClassId, InstanceNum), Str) :-
llds_out__make_base_typeclass_info_name(ClassId, InstanceNum, Str).
opt_debug__dump_data_name(proc_layout(Label), Str) :-
Index: compiler/options.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/options.m,v
retrieving revision 1.252
diff -u -r1.252 options.m
--- options.m 1998/12/06 23:44:15 1.252
+++ options.m 1999/03/15 12:27:32
@@ -1732,7 +1732,7 @@
"--no-type-layout",
"(This option is not for general use.)",
- "\tDon't output base_type_layout structures or references",
+ "\tDon't output type_ctor_layout structures or references",
"\tto them. (The C code also needs to be compiled with",
"\t`-DNO_TYPE_LAYOUT').",
Index: compiler/polymorphism.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/polymorphism.m,v
retrieving revision 1.159
diff -u -r1.159 polymorphism.m
--- polymorphism.m 1999/02/28 06:54:21 1.159
+++ polymorphism.m 1999/03/15 12:27:35
@@ -37,15 +37,15 @@
% TO THE TYPE SPECIALIZATION CODE IN "compiler/higher_order.m".
%
% Type information is represented using one or two cells. The cell which
-% is always present is the base_type_info structure, laid out like this:
+% is always present is the type_ctor_info structure, laid out like this:
%
% word 0 <arity of type constructor>
% e.g. 0 for `int', 1 for `list(T)', 2 for `map(K, V)'.
% word 1 <=/2 predicate for type>
% word 2 <index/2 predicate for type>
% word 3 <compare/3 predicate for type>
-% word 4 <base_type_layout for type>
-% word 5 <base_type_functors for type>
+% word 4 <type_ctor_layout for type>
+% word 5 <type_ctor_functors for type>
% word 6 <string name of type constructor>
% e.g. "int" for `int', "list" for `list(T)',
% "map" for `map(K,V)'
@@ -53,7 +53,7 @@
%
% The other cell is the type_info structure, laid out like this:
%
-% word 0 <pointer to the base_type_info structure>
+% word 0 <pointer to the type_ctor_info structure>
% word 1+ <the type_infos for the type params, at least one>
%
% (but see note below for how higher order types differ)
@@ -64,38 +64,38 @@
%
% The type_info structure itself is redundant if the type has no type
% parameters (i.e. its arity is zero). Therefore if the arity is zero,
-% we pass the address of the base_type_info structure directly, instead of
+% we pass the address of the type_ctor_info structure directly, instead of
% wrapping it up in another cell. The runtime system will look at the first
% field of the cell it is passed. If this field is zero, the cell is a
-% base_type_info structure for an arity zero type. If this field is not zero,
+% type_ctor_info structure for an arity zero type. If this field is not zero,
% the cell is a new type_info structure, with the first field being the
-% pointer to the base_type_info structure.
+% pointer to the type_ctor_info structure.
%
%-----------------------------------------------------------------------------%
%
% Higher order types:
%
% There is a slight variation on this for higher-order types. Higher
-% order type_infos always have a pointer to the pred/0 base_type_info,
+% order type_infos always have a pointer to the pred/0 type_ctor_info,
% regardless of their true arity, so we store the real arity in the
% type-info as well.
%
-% word 0 <pointer to the base_type_info structure (pred/0)>
+% word 0 <pointer to the type_ctor_info structure (pred/0)>
% word 1 <arity of predicate>
% word 2+ <the type_infos for the type params, at least one>
%
%-----------------------------------------------------------------------------%
%
-% Sharing base_type_info structures:
+% Sharing type_ctor_info structures:
%
% For compilation models that can put code addresses in static ground terms,
-% we can arrange to create one copy of the base_type_info structure statically,
+% we can arrange to create one copy of the type_ctor_info structure statically,
% avoiding the need to create other copies at runtime. For compilation models
% that cannot put code addresses in static ground terms, there are a couple
% of things we could do:
%
% 1. allocate all cells at runtime.
-% 2. use a shared static base_type_info, but initialize its code
+% 2. use a shared static type_ctor_info, but initialize its code
% addresses during startup (that is, during the module
% initialization code).
%
@@ -123,32 +123,32 @@
% We transform the body of p to this:
%
% p(TypeInfoT1, X) :-
-% BaseTypeInfoT2 = base_type_info(
+% TypeCtorInfoT2 = type_ctor_info(
% 1,
% '__Unify__'<list/1>,
% '__Index__'<list/1>,
% '__Compare__'<list/1>,
-% <base_type_layout for list/1>,
-% <base_type_functors for list/1>,
+% <type_ctor_layout for list/1>,
+% <type_ctor_functors for list/1>,
% "list",
% "list"),
% TypeInfoT2 = type_info(
-% BaseTypeInfoT2,
+% TypeCtorInfoT2,
% TypeInfoT1),
% q(TypeInfoT2, [X]),
-% TypeInfoT3 = base_type_info(
+% TypeInfoT3 = type_ctor_info(
% 0,
% builtin_unify_int,
% builtin_index_int,
% builtin_compare_int,
-% <base_type_layout for int/0>,
-% <base_type_functors for int/0>,
+% <type_ctor_layout for int/0>,
+% <type_ctor_functors for int/0>,
% "int",
% "builtin"),
% r(TypeInfoT3, 0).
%
-% Note that base_type_infos are actually generated as references to a
-% single shared base_type_info.
+% Note that type_ctor_infos are actually generated as references to a
+% single shared type_ctor_info.
%
%-----------------------------------------------------------------------------%
%-----------------------------------------------------------------------------%
@@ -166,7 +166,7 @@
% The typeclass_info is represented in two parts (the typeclass_info
% itself, and a base_typeclass_info), in a similar fashion to the
% type_info being represented in two parts (the type_info and the
-% base_type_info).
+% type_ctor_info).
%
% The base_typeclass_info contains:
% * the number of constraints on the instance decl.
@@ -2306,7 +2306,7 @@
poly_info_get_var_types(Info1, VarTypes1),
poly_info_get_module_info(Info1, ModuleInfo),
- polymorphism__init_const_base_type_info_var(Type,
+ polymorphism__init_const_type_ctor_info_var(Type,
TypeId, ModuleInfo, VarSet1, VarTypes1,
BaseVar, BaseGoal, VarSet2, VarTypes2),
polymorphism__maybe_init_second_cell(ArgTypeInfoVars,
@@ -2341,9 +2341,9 @@
->
Var = BaseVar,
- % Since this base_type_info is pretending to be
+ % Since this type_ctor_info is pretending to be
% a type_info, we need to adjust its type.
- % Since base_type_info_const cons_ids are handled
+ % Since type_ctor_info_const cons_ids are handled
% specially, this should not cause problems.
mercury_private_builtin_module(MercuryBuiltin),
construct_type(qualified(MercuryBuiltin, "type_info") - 1,
@@ -2355,7 +2355,7 @@
;
% Unfortunately, if we have higher order terms, we
% can no longer just optimise them to be the actual
- % base_type_info
+ % type_ctor_info
(
IsHigherOrder = yes
->
@@ -2480,7 +2480,7 @@
error("polymorphism__get_builtin_pred_id: pred_id lookup failed")
).
- % Create a unification for a type_info or base_type_info variable:
+ % Create a unification for a type_info or type_ctor_info variable:
%
% TypeInfoVar = type_info(CountVar,
% SpecialPredVars...,
@@ -2488,7 +2488,7 @@
%
% or
%
- % BaseTypeInfoVar = base_type_type_info(CountVar,
+ % TypeCtorInfoVar = base_type_type_info(CountVar,
% SpecialPredVars...)
%
% These unifications WILL lead to the creation of cells on the
@@ -2538,52 +2538,52 @@
TypeInfoGoal = Unify - GoalInfo.
- % Create a unification for a type_info or base_type_info variable:
+ % Create a unification for a type_info or type_ctor_info variable:
%
- % BaseTypeInfoVar = base_type_type_info(CountVar,
+ % TypeCtorInfoVar = base_type_type_info(CountVar,
% SpecialPredVars...)
%
% This unification will NOT lead to the creation of a cell on the
- % heap at runtime; it will cause BaseTypeInfoVar to refer to the
- % statically allocated base_type_info cell for the type, allocated
+ % heap at runtime; it will cause TypeCtorInfoVar to refer to the
+ % statically allocated type_ctor_info cell for the type, allocated
% in the module that defines the type.
-:- pred polymorphism__init_const_base_type_info_var(type, type_id,
+:- pred polymorphism__init_const_type_ctor_info_var(type, type_id,
module_info, prog_varset, map(prog_var, type), prog_var, hlds_goal,
prog_varset, map(prog_var, type)).
-:- mode polymorphism__init_const_base_type_info_var(in, in, in, in, in,
+:- mode polymorphism__init_const_type_ctor_info_var(in, in, in, in, in,
out, out, out, out) is det.
-polymorphism__init_const_base_type_info_var(Type, TypeId,
- ModuleInfo, VarSet0, VarTypes0, BaseTypeInfoVar,
- BaseTypeInfoGoal, VarSet, VarTypes) :-
+polymorphism__init_const_type_ctor_info_var(Type, TypeId,
+ ModuleInfo, VarSet0, VarTypes0, TypeCtorInfoVar,
+ TypeCtorInfoGoal, VarSet, VarTypes) :-
type_util__type_id_module(ModuleInfo, TypeId, ModuleName),
type_util__type_id_name(ModuleInfo, TypeId, TypeName),
TypeId = _ - Arity,
- ConsId = base_type_info_const(ModuleName, TypeName, Arity),
+ ConsId = type_ctor_info_const(ModuleName, TypeName, Arity),
TypeInfoTerm = functor(ConsId, []),
% introduce a new variable
- polymorphism__new_type_info_var(Type, "base_type_info",
- VarSet0, VarTypes0, BaseTypeInfoVar, VarSet, VarTypes),
+ polymorphism__new_type_info_var(Type, "type_ctor_info",
+ VarSet0, VarTypes0, TypeCtorInfoVar, VarSet, VarTypes),
% create the construction unification to initialize the variable
- Unification = construct(BaseTypeInfoVar, ConsId, [], []),
+ Unification = construct(TypeCtorInfoVar, ConsId, [], []),
UnifyMode = (free -> ground(shared, no)) -
(ground(shared, no) -> ground(shared, no)),
UnifyContext = unify_context(explicit, []),
% XXX the UnifyContext is wrong
- Unify = unify(BaseTypeInfoVar, TypeInfoTerm, UnifyMode,
+ Unify = unify(TypeCtorInfoVar, TypeInfoTerm, UnifyMode,
Unification, UnifyContext),
% create a goal_info for the unification
- set__list_to_set([BaseTypeInfoVar], NonLocals),
- instmap_delta_from_assoc_list([BaseTypeInfoVar - ground(shared, no)],
+ set__list_to_set([TypeCtorInfoVar], NonLocals),
+ instmap_delta_from_assoc_list([TypeCtorInfoVar - ground(shared, no)],
InstmapDelta),
goal_info_init(NonLocals, InstmapDelta, det, GoalInfo),
- BaseTypeInfoGoal = Unify - GoalInfo.
+ TypeCtorInfoGoal = Unify - GoalInfo.
%---------------------------------------------------------------------------%
Index: compiler/rl_exprn.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rl_exprn.m,v
retrieving revision 1.1
diff -u -r1.1 rl_exprn.m
--- rl_exprn.m 1998/12/06 23:45:01 1.1
+++ rl_exprn.m 1999/03/15 12:27:43
@@ -327,7 +327,7 @@
rl_exprn__set_term_arg_cons_id_code(code_addr_const(_, _),
_, _, _, _, _, _) -->
{ error("rl_exprn__set_term_arg_cons_id_code") }.
-rl_exprn__set_term_arg_cons_id_code(base_type_info_const(_, _, _),
+rl_exprn__set_term_arg_cons_id_code(type_ctor_info_const(_, _, _),
_, _, _, _, _, _) -->
{ error("rl_exprn__set_term_arg_cons_id_code") }.
rl_exprn__set_term_arg_cons_id_code(base_typeclass_info_const(_, _, _, _),
@@ -835,7 +835,7 @@
{ SymName = qualified(unqualified("mercury_builtin"),
TypeInfo) },
( { TypeInfo = "type_info" }
- ; { TypeInfo = "base_type_info" }
+ ; { TypeInfo = "type_ctor_info" }
)
->
% XXX for now we ignore these and hope it doesn't
@@ -877,7 +877,7 @@
{ ConsId = code_addr_const(_, _) },
{ error("rl_exprn__unify: unsupported cons_id - code_addr_const") }
;
- { ConsId = base_type_info_const(_, _, _) },
+ { ConsId = type_ctor_info_const(_, _, _) },
% XXX for now we ignore these and hope it doesn't matter.
% They may be introduced for calls to the automatically
% generated unification and comparison procedures.
Index: compiler/switch_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/switch_gen.m,v
retrieving revision 1.68
diff -u -r1.68 switch_gen.m
--- switch_gen.m 1998/11/24 03:57:19 1.68
+++ switch_gen.m 1999/03/15 12:27:51
@@ -211,7 +211,7 @@
switch_gen__priority(string_constant(_), 5).
switch_gen__priority(pred_closure_tag(_, _), 6). % should never occur
switch_gen__priority(code_addr_constant(_, _), 6). % should never occur
-switch_gen__priority(base_type_info_constant(_, _, _), 6).% should never occur
+switch_gen__priority(type_ctor_info_constant(_, _, _), 6).% should never occur
switch_gen__priority(base_typeclass_info_constant(_, _, _), 6).% shouldn't occur
switch_gen__priority(tabling_pointer_constant(_, _), 6). % shouldn't occur
Index: compiler/type_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/type_util.m,v
retrieving revision 1.62
diff -u -r1.62 type_util.m
--- type_util.m 1998/12/06 23:45:57 1.62
+++ type_util.m 1999/03/15 12:27:55
@@ -266,7 +266,7 @@
type_id_is_hand_defined(qualified(PrivateBuiltin, "type_info") - 1) :-
mercury_private_builtin_module(PrivateBuiltin).
-type_id_is_hand_defined(qualified(PrivateBuiltin, "base_type_info") - 1) :-
+type_id_is_hand_defined(qualified(PrivateBuiltin, "type_ctor_info") - 1) :-
mercury_private_builtin_module(PrivateBuiltin).
type_id_is_hand_defined(qualified(PrivateBuiltin, "typeclass_info") - 1) :-
mercury_private_builtin_module(PrivateBuiltin).
@@ -436,7 +436,7 @@
%-----------------------------------------------------------------------------%
- % The checks for type_info and base_type_info
+ % The checks for type_info and type_ctor_info
% are needed because those types lie about their
% arity; it might be cleaner to change that in
% private_builtin.m, but that would cause some
@@ -453,7 +453,7 @@
ExistQVars = [],
unqualify_name(Ctor, Name),
Name \= "type_info",
- Name \= "base_type_info",
+ Name \= "type_ctor_info",
Name \= "typeclass_info",
Name \= "base_typeclass_info".
Index: compiler/unify_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/unify_gen.m,v
retrieving revision 1.93
diff -u -r1.93 unify_gen.m
--- unify_gen.m 1998/11/24 03:57:23 1.93
+++ unify_gen.m 1999/03/15 12:27:57
@@ -225,9 +225,9 @@
unify_gen__generate_tag_rval_2(code_addr_constant(_, _), _Rval, _TestRval) :-
% This should never happen
error("Attempted code_addr unification").
-unify_gen__generate_tag_rval_2(base_type_info_constant(_, _, _), _, _) :-
+unify_gen__generate_tag_rval_2(type_ctor_info_constant(_, _, _), _, _) :-
% This should never happen
- error("Attempted base_type_info unification").
+ error("Attempted type_ctor_info unification").
unify_gen__generate_tag_rval_2(base_typeclass_info_constant(_, _, _), _, _) :-
% This should never happen
error("Attempted base_typeclass_info unification").
@@ -328,7 +328,7 @@
{ Code = empty },
code_info__cache_expression(Var,
mkword(Bits1, unop(mkbody, const(int_const(Num1))))).
-unify_gen__generate_construction_2(base_type_info_constant(ModuleName,
+unify_gen__generate_construction_2(type_ctor_info_constant(ModuleName,
TypeName, TypeArity), Var, Args, _Modes, Code) -->
( { Args = [] } ->
[]
@@ -337,7 +337,7 @@
),
{ Code = empty },
code_info__cache_expression(Var, const(data_addr_const(data_addr(
- ModuleName, base_type(info, TypeName, TypeArity))))).
+ ModuleName, type_ctor(info, TypeName, TypeArity))))).
unify_gen__generate_construction_2(base_typeclass_info_constant(ModuleName,
ClassId, Instance), Var, Args, _Modes, Code) -->
( { Args = [] } ->
@@ -626,7 +626,7 @@
{ Tag = code_addr_constant(_, _) },
{ Code = empty }
;
- { Tag = base_type_info_constant(_, _, _) },
+ { Tag = type_ctor_info_constant(_, _, _) },
{ Code = empty }
;
{ Tag = base_typeclass_info_constant(_, _, _) },
Index: library/array.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/array.m,v
retrieving revision 1.51
diff -u -r1.51 array.m
--- array.m 1998/12/04 04:41:09 1.51
+++ array.m 1999/03/16 05:27:52
@@ -267,18 +267,18 @@
#ifdef USE_TYPE_LAYOUT
MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data_array__base_type_layout_array_1_struct {
+const struct mercury_data_array__type_ctor_layout_array_1_struct {
TYPE_LAYOUT_FIELDS
-} mercury_data_array__base_type_layout_array_1 = {
- make_typelayout_for_all_tags(TYPELAYOUT_CONST_TAG,
- mkbody(TYPELAYOUT_ARRAY_VALUE))
+} mercury_data_array__type_ctor_layout_array_1 = {
+ make_typelayout_for_all_tags(TYPE_CTOR_LAYOUT_CONST_TAG,
+ mkbody(TYPE_CTOR_LAYOUT_ARRAY_VALUE))
};
MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data_array__base_type_functors_array_1_struct {
+const struct mercury_data_array__type_ctor_functors_array_1_struct {
Integer f1;
-} mercury_data_array__base_type_functors_array_1 = {
- MR_TYPEFUNCTORS_SPECIAL
+} mercury_data_array__type_ctor_functors_array_1 = {
+ MR_TYPE_CTOR_FUNCTORS_SPECIAL
};
#endif
Index: library/builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/builtin.m,v
retrieving revision 1.9
diff -u -r1.9 builtin.m
--- builtin.m 1998/11/07 02:09:08 1.9
+++ builtin.m 1999/03/16 05:27:53
@@ -244,115 +244,115 @@
#ifdef USE_TYPE_LAYOUT
- /* base_type_layout definitions */
+ /* type_ctor_layout definitions */
- /* base_type_layout for `int' */
+ /* type_ctor_layout for `int' */
MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data___base_type_layout_int_0_struct {
+const struct mercury_data___type_ctor_layout_int_0_struct {
TYPE_LAYOUT_FIELDS
-} mercury_data___base_type_layout_int_0 = {
- make_typelayout_for_all_tags(TYPELAYOUT_CONST_TAG,
- mkbody(TYPELAYOUT_INT_VALUE))
+} mercury_data___type_ctor_layout_int_0 = {
+ make_typelayout_for_all_tags(TYPE_CTOR_LAYOUT_CONST_TAG,
+ mkbody(TYPE_CTOR_LAYOUT_INT_VALUE))
};
- /* base_type_layout for `character' */
+ /* type_ctor_layout for `character' */
MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data___base_type_layout_character_0_struct {
+const struct mercury_data___type_ctor_layout_character_0_struct {
TYPE_LAYOUT_FIELDS
-} mercury_data___base_type_layout_character_0 = {
- make_typelayout_for_all_tags(TYPELAYOUT_CONST_TAG,
- mkbody(TYPELAYOUT_CHARACTER_VALUE))
+} mercury_data___type_ctor_layout_character_0 = {
+ make_typelayout_for_all_tags(TYPE_CTOR_LAYOUT_CONST_TAG,
+ mkbody(TYPE_CTOR_LAYOUT_CHARACTER_VALUE))
};
- /* base_type_layout for `string' */
+ /* type_ctor_layout for `string' */
MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data___base_type_layout_string_0_struct {
+const struct mercury_data___type_ctor_layout_string_0_struct {
TYPE_LAYOUT_FIELDS
-} mercury_data___base_type_layout_string_0 = {
- make_typelayout_for_all_tags(TYPELAYOUT_CONST_TAG,
- mkbody(TYPELAYOUT_STRING_VALUE))
+} mercury_data___type_ctor_layout_string_0 = {
+ make_typelayout_for_all_tags(TYPE_CTOR_LAYOUT_CONST_TAG,
+ mkbody(TYPE_CTOR_LAYOUT_STRING_VALUE))
};
- /* base_type_layout for `float' */
+ /* type_ctor_layout for `float' */
MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data___base_type_layout_float_0_struct {
+const struct mercury_data___type_ctor_layout_float_0_struct {
TYPE_LAYOUT_FIELDS
-} mercury_data___base_type_layout_float_0 = {
- make_typelayout_for_all_tags(TYPELAYOUT_CONST_TAG,
- mkbody(TYPELAYOUT_FLOAT_VALUE))
+} mercury_data___type_ctor_layout_float_0 = {
+ make_typelayout_for_all_tags(TYPE_CTOR_LAYOUT_CONST_TAG,
+ mkbody(TYPE_CTOR_LAYOUT_FLOAT_VALUE))
};
- /* base_type_layout for `void' */
+ /* type_ctor_layout for `void' */
MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data___base_type_layout_void_0_struct {
+const struct mercury_data___type_ctor_layout_void_0_struct {
TYPE_LAYOUT_FIELDS
-} mercury_data___base_type_layout_void_0 = {
- make_typelayout_for_all_tags(TYPELAYOUT_CONST_TAG,
- mkbody(TYPELAYOUT_VOID_VALUE))
+} mercury_data___type_ctor_layout_void_0 = {
+ make_typelayout_for_all_tags(TYPE_CTOR_LAYOUT_CONST_TAG,
+ mkbody(TYPE_CTOR_LAYOUT_VOID_VALUE))
};
- /* base_type_functors definitions */
+ /* type_ctor_functors definitions */
- /* base_type_functors for `int' */
+ /* type_ctor_functors for `int' */
MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data___base_type_functors_int_0_struct {
+const struct mercury_data___type_ctor_functors_int_0_struct {
Integer f1;
-} mercury_data___base_type_functors_int_0 = {
- MR_TYPEFUNCTORS_SPECIAL
+} mercury_data___type_ctor_functors_int_0 = {
+ MR_TYPE_CTOR_FUNCTORS_SPECIAL
};
- /* base_type_functors for `character' */
+ /* type_ctor_functors for `character' */
MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data___base_type_functors_character_0_struct {
+const struct mercury_data___type_ctor_functors_character_0_struct {
Integer f1;
-} mercury_data___base_type_functors_character_0 = {
- MR_TYPEFUNCTORS_SPECIAL
+} mercury_data___type_ctor_functors_character_0 = {
+ MR_TYPE_CTOR_FUNCTORS_SPECIAL
};
- /* base_type_functors for `string' */
+ /* type_ctor_functors for `string' */
MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data___base_type_functors_string_0_struct {
+const struct mercury_data___type_ctor_functors_string_0_struct {
Integer f1;
-} mercury_data___base_type_functors_string_0 = {
- MR_TYPEFUNCTORS_SPECIAL
+} mercury_data___type_ctor_functors_string_0 = {
+ MR_TYPE_CTOR_FUNCTORS_SPECIAL
};
- /* base_type_functors for `float' */
+ /* type_ctor_functors for `float' */
MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data___base_type_functors_float_0_struct {
+const struct mercury_data___type_ctor_functors_float_0_struct {
Integer f1;
-} mercury_data___base_type_functors_float_0 = {
- MR_TYPEFUNCTORS_SPECIAL
+} mercury_data___type_ctor_functors_float_0 = {
+ MR_TYPE_CTOR_FUNCTORS_SPECIAL
};
- /* base_type_functors for `void' */
+ /* type_ctor_functors for `void' */
MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data___base_type_functors_void_0_struct {
+const struct mercury_data___type_ctor_functors_void_0_struct {
Integer f1;
-} mercury_data___base_type_functors_void_0 = {
- MR_TYPEFUNCTORS_SPECIAL
+} mercury_data___type_ctor_functors_void_0 = {
+ MR_TYPE_CTOR_FUNCTORS_SPECIAL
};
#endif /* USE_TYPE_LAYOUT */
- /* base_type_infos definitions */
+ /* type_ctor_infos definitions */
- /* base_type_info for `int' */
+ /* type_ctor_info for `int' */
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___base_type_info_int_0_struct {
+MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_int_0_struct {
Integer f1;
Code *f2;
Code *f3;
@@ -363,26 +363,26 @@
const Word *f7;
const Word *f8;
#endif
-} mercury_data___base_type_info_int_0 = {
+} 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
- (const Word *) & mercury_data___base_type_layout_int_0,
- (const Word *) & mercury_data___base_type_functors_int_0,
+ (const Word *) & mercury_data___type_ctor_layout_int_0,
+ (const Word *) & mercury_data___type_ctor_functors_int_0,
(const Word *) string_const(""builtin"", 15),
(const Word *) string_const(""int"", 3)
#endif
};
- /* base_type_info for `character' */
+ /* type_ctor_info for `character' */
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___base_type_info_character_0_struct {
+mercury_data___type_ctor_info_character_0_struct {
Integer f1;
Code *f2;
Code *f3;
@@ -393,25 +393,25 @@
const Word *f7;
const Word *f8;
#endif
-} mercury_data___base_type_info_character_0 = {
+} 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
- (const Word *) & mercury_data___base_type_layout_character_0,
- (const Word *) & mercury_data___base_type_functors_character_0,
+ (const Word *) & mercury_data___type_ctor_layout_character_0,
+ (const Word *) & mercury_data___type_ctor_functors_character_0,
(const Word *) string_const(""builtin"", 15),
(const Word *) string_const(""character"", 9)
#endif
};
- /* base_type_info for `string' */
+ /* type_ctor_info for `string' */
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___base_type_info_string_0_struct {
+MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_string_0_struct {
Integer f1;
Code *f2;
Code *f3;
@@ -422,25 +422,25 @@
const Word *f7;
const Word *f8;
#endif
-} mercury_data___base_type_info_string_0 = {
+} 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
- (const Word *) & mercury_data___base_type_layout_string_0,
- (const Word *) & mercury_data___base_type_functors_string_0,
+ (const Word *) & mercury_data___type_ctor_layout_string_0,
+ (const Word *) & mercury_data___type_ctor_functors_string_0,
(const Word *) string_const(""builtin"", 15),
(const Word *) string_const(""string"", 6)
#endif
};
- /* base_type_info for `float' */
+ /* type_ctor_info for `float' */
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___base_type_info_float_0_struct {
+MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_float_0_struct {
Integer f1;
Code *f2;
Code *f3;
@@ -451,23 +451,23 @@
const Word *f7;
const Word *f8;
#endif
-} mercury_data___base_type_info_float_0 = {
+} 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
- (const Word *) & mercury_data___base_type_layout_float_0,
- (const Word *) & mercury_data___base_type_functors_float_0,
+ (const Word *) & mercury_data___type_ctor_layout_float_0,
+ (const Word *) & mercury_data___type_ctor_functors_float_0,
(const Word *) string_const(""builtin"", 15),
(const Word *) string_const(""float"", 5)
#endif
};
- /* base_type_info for `void' */
+ /* type_ctor_info for `void' */
Declare_entry(mercury__unused_0_0);
-MR_STATIC_CODE_CONST struct mercury_data___base_type_info_void_0_struct {
+MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_void_0_struct {
Integer f1;
Code *f2;
Code *f3;
@@ -478,14 +478,14 @@
const Word *f7;
const Word *f8;
#endif
-} mercury_data___base_type_info_void_0 = {
+} 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
- (const Word *) & mercury_data___base_type_layout_void_0,
- (const Word *) & mercury_data___base_type_functors_void_0,
+ (const Word *) & mercury_data___type_ctor_layout_void_0,
+ (const Word *) & mercury_data___type_ctor_functors_void_0,
(const Word *) string_const(""builtin"", 15),
(const Word *) string_const(""void"", 4)
#endif
@@ -511,21 +511,21 @@
** We had better call this init() because we use the
** labels for the special preds of int, float, pred,
** character and string. If they aren't initialized,
- ** we might initialize the base_type_info with
+ ** we might initialize the type_ctor_info with
** garbage
*/
mercury__private_builtin__init();
- MR_INIT_BUILTIN_BASE_TYPE_INFO(
- mercury_data___base_type_info_int_0, _int_);
- MR_INIT_BUILTIN_BASE_TYPE_INFO(
- mercury_data___base_type_info_float_0, _float_);
- MR_INIT_BUILTIN_BASE_TYPE_INFO(
- mercury_data___base_type_info_character_0, _character_);
- MR_INIT_BUILTIN_BASE_TYPE_INFO(
- mercury_data___base_type_info_string_0, _string_);
- MR_INIT_BASE_TYPE_INFO_WITH_PRED(
- mercury_data___base_type_info_void_0, mercury__unused_0_0);
+ MR_INIT_BUILTIN_TYPE_CTOR_INFO(
+ mercury_data___type_ctor_info_int_0, _int_);
+ MR_INIT_BUILTIN_TYPE_CTOR_INFO(
+ mercury_data___type_ctor_info_float_0, _float_);
+ MR_INIT_BUILTIN_TYPE_CTOR_INFO(
+ mercury_data___type_ctor_info_character_0, _character_);
+ MR_INIT_BUILTIN_TYPE_CTOR_INFO(
+ mercury_data___type_ctor_info_string_0, _string_);
+ MR_INIT_TYPE_CTOR_INFO_WITH_PRED(
+ mercury_data___type_ctor_info_void_0, mercury__unused_0_0);
}
").
@@ -627,19 +627,19 @@
#ifdef USE_TYPE_LAYOUT
MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data_builtin__base_type_layout_c_pointer_0_struct {
+const struct mercury_data_builtin__type_ctor_layout_c_pointer_0_struct {
TYPE_LAYOUT_FIELDS
-} mercury_data_builtin__base_type_layout_c_pointer_0 = {
- make_typelayout_for_all_tags(TYPELAYOUT_CONST_TAG,
- mkbody(TYPELAYOUT_C_POINTER_VALUE))
+} mercury_data_builtin__type_ctor_layout_c_pointer_0 = {
+ make_typelayout_for_all_tags(TYPE_CTOR_LAYOUT_CONST_TAG,
+ mkbody(TYPE_CTOR_LAYOUT_C_POINTER_VALUE))
};
MR_MODULE_STATIC_OR_EXTERN
const struct
-mercury_data_builtin__base_type_functors_c_pointer_0_struct {
+mercury_data_builtin__type_ctor_functors_c_pointer_0_struct {
Integer f1;
-} mercury_data_builtin__base_type_functors_c_pointer_0 = {
- MR_TYPEFUNCTORS_SPECIAL
+} mercury_data_builtin__type_ctor_functors_c_pointer_0 = {
+ MR_TYPE_CTOR_FUNCTORS_SPECIAL
};
#endif
Index: library/private_builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/private_builtin.m,v
retrieving revision 1.16
diff -u -r1.16 private_builtin.m
--- private_builtin.m 1998/12/02 00:51:56 1.16
+++ private_builtin.m 1999/03/16 05:27:53
@@ -76,7 +76,7 @@
% The code generated by polymorphism.m always requires
% the existence of a type_info functor, and requires
- % the existence of a base_type_info functor as well
+ % the existence of a type_ctor_info functor as well
% when using --type-info {shared-,}one-or-two-cell.
%
% The actual arities of these two function symbols are variable;
@@ -88,8 +88,8 @@
% are candidates to become no_tag types, special code is required in
% type_util:type_is_no_tag_type/3.
-:- type type_info(T) ---> type_info(base_type_info(T) /*, ... */).
-:- type base_type_info(T) ---> base_type_info(int /*, ... */).
+:- type type_info(T) ---> type_info(type_ctor_info(T) /*, ... */).
+:- type type_ctor_info(T) ---> type_ctor_info(int /*, ... */).
% The type variable in these types isn't really a type variable,
% it's a place for polymorphism.m to put a representation of the
@@ -524,8 +524,8 @@
#define ML_UNINITIALIZED 0
#define ML_WORKING_ON_ANS 1
#define ML_FAILED 2
- /* The values 3..TYPELAYOUT_MAX_VARINT are reserved for future use */
-#define ML_SUCCEEDED TYPELAYOUT_MAX_VARINT
+ /* The values 3..TYPE_CTOR_LAYOUT_MAX_VARINT are reserved for future use */
+#define ML_SUCCEEDED TYPE_CTOR_LAYOUT_MAX_VARINT
/* This or any greater value indicate that the subgoal has
** succeeded. */
@@ -611,42 +611,42 @@
:- pragma c_header_code("
extern MR_STATIC_CODE_CONST struct
- mercury_data___base_type_info_int_0_struct
- mercury_data___base_type_info_int_0;
+ mercury_data___type_ctor_info_int_0_struct
+ mercury_data___type_ctor_info_int_0;
extern MR_STATIC_CODE_CONST struct
- mercury_data___base_type_info_string_0_struct
- mercury_data___base_type_info_string_0;
+ mercury_data___type_ctor_info_string_0_struct
+ mercury_data___type_ctor_info_string_0;
extern MR_STATIC_CODE_CONST struct
- mercury_data___base_type_info_float_0_struct
- mercury_data___base_type_info_float_0;
+ mercury_data___type_ctor_info_float_0_struct
+ mercury_data___type_ctor_info_float_0;
extern MR_STATIC_CODE_CONST struct
- mercury_data___base_type_info_character_0_struct
- mercury_data___base_type_info_character_0;
+ mercury_data___type_ctor_info_character_0_struct
+ mercury_data___type_ctor_info_character_0;
").
:- pragma c_code(table_save_int_ans(T::in, Offset::in, I::in),
will_not_call_mercury, "
MR_TABLE_SAVE_ANSWER(Offset, T, I,
- mercury_data___base_type_info_int_0);
+ mercury_data___type_ctor_info_int_0);
").
:- pragma c_code(table_save_char_ans(T::in, Offset::in, C::in),
will_not_call_mercury, "
MR_TABLE_SAVE_ANSWER(Offset, T, C,
- mercury_data___base_type_info_character_0);
+ mercury_data___type_ctor_info_character_0);
").
:- pragma c_code(table_save_string_ans(T::in, Offset::in, S::in),
will_not_call_mercury, "
MR_TABLE_SAVE_ANSWER(Offset, T, (Word) S,
- mercury_data___base_type_info_string_0);
+ mercury_data___type_ctor_info_string_0);
").
:- pragma c_code(table_save_float_ans(T::in, Offset::in, F::in),
will_not_call_mercury, "
MR_TABLE_SAVE_ANSWER(Offset, T, float_to_word(F),
- mercury_data___base_type_info_float_0);
+ mercury_data___type_ctor_info_float_0);
").
:- pragma c_code(table_save_any_ans(T::in, Offset::in, V::in),
@@ -1304,7 +1304,7 @@
").
- % The definitions for base_type_info/1 and type_info/1.
+ % The definitions for type_ctor_info/1 and type_info/1.
:- pragma c_code("
@@ -1313,20 +1313,20 @@
Define_extern_entry(mercury____Compare___private_builtin__type_info_1_0);
extern const struct
- mercury_data_private_builtin__base_type_layout_type_info_1_struct
- mercury_data_private_builtin__base_type_layout_type_info_1;
+ mercury_data_private_builtin__type_ctor_layout_type_info_1_struct
+ mercury_data_private_builtin__type_ctor_layout_type_info_1;
extern const struct
- mercury_data_private_builtin__base_type_functors_type_info_1_struct
- mercury_data_private_builtin__base_type_functors_type_info_1;
+ mercury_data_private_builtin__type_ctor_functors_type_info_1_struct
+ mercury_data_private_builtin__type_ctor_functors_type_info_1;
/*
- ** For most purposes, base_type_info can be treated just like
+ ** For most purposes, type_ctor_info can be treated just like
** type_info. The code that handles type_infos can also handle
- ** base_type_infos.
+ ** type_ctor_infos.
*/
MR_STATIC_CODE_CONST struct
-mercury_data_private_builtin__base_type_info_base_type_info_1_struct {
+mercury_data_private_builtin__type_ctor_info_type_ctor_info_1_struct {
Integer f1;
Code *f2;
Code *f3;
@@ -1335,7 +1335,7 @@
const Word *f6;
const Word *f7;
const Word *f8;
-} mercury_data_private_builtin__base_type_info_base_type_info_1 = {
+} 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)),
@@ -1344,15 +1344,15 @@
MR_MAYBE_STATIC_CODE(ENTRY(
mercury____Compare___private_builtin__type_info_1_0)),
(const Word *) &
- mercury_data_private_builtin__base_type_layout_type_info_1,
+ mercury_data_private_builtin__type_ctor_layout_type_info_1,
(const Word *) &
- mercury_data_private_builtin__base_type_functors_type_info_1,
+ mercury_data_private_builtin__type_ctor_functors_type_info_1,
(const Word *) string_const(""private_builtin"", 15),
- (const Word *) string_const(""base_type_info"", 14)
+ (const Word *) string_const(""type_ctor_info"", 14)
};
MR_STATIC_CODE_CONST struct
-mercury_data_private_builtin__base_type_info_type_info_1_struct {
+mercury_data_private_builtin__type_ctor_info_type_info_1_struct {
Integer f1;
Code *f2;
Code *f3;
@@ -1361,7 +1361,7 @@
const Word *f6;
const Word *f7;
const Word *f8;
-} mercury_data_private_builtin__base_type_info_type_info_1 = {
+} 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)),
@@ -1370,25 +1370,25 @@
MR_MAYBE_STATIC_CODE(ENTRY(
mercury____Compare___private_builtin__type_info_1_0)),
(const Word *) &
- mercury_data_private_builtin__base_type_layout_type_info_1,
+ mercury_data_private_builtin__type_ctor_layout_type_info_1,
(const Word *) &
- mercury_data_private_builtin__base_type_functors_type_info_1,
+ mercury_data_private_builtin__type_ctor_functors_type_info_1,
(const Word *) string_const(""private_builtin"", 15),
(const Word *) string_const(""type_info"", 9)
};
-const struct mercury_data_private_builtin__base_type_layout_type_info_1_struct {
+const struct mercury_data_private_builtin__type_ctor_layout_type_info_1_struct {
TYPE_LAYOUT_FIELDS
-} mercury_data_private_builtin__base_type_layout_type_info_1 = {
- make_typelayout_for_all_tags(TYPELAYOUT_CONST_TAG,
- mkbody(MR_TYPELAYOUT_TYPEINFO_VALUE))
+} mercury_data_private_builtin__type_ctor_layout_type_info_1 = {
+ make_typelayout_for_all_tags(TYPE_CTOR_LAYOUT_CONST_TAG,
+ mkbody(MR_TYPE_CTOR_LAYOUT_TYPEINFO_VALUE))
};
-const struct mercury_data_private_builtin__base_type_functors_type_info_1_struct {
+const struct mercury_data_private_builtin__type_ctor_functors_type_info_1_struct {
Integer f1;
-} mercury_data_private_builtin__base_type_functors_type_info_1 = {
- MR_TYPEFUNCTORS_SPECIAL
+} mercury_data_private_builtin__type_ctor_functors_type_info_1 = {
+ MR_TYPE_CTOR_FUNCTORS_SPECIAL
};
BEGIN_MODULE(type_info_module)
More information about the developers
mailing list