[m-rev.] deleting the code for undiscriminated unions
Zoltan Somogyi
zs at cs.mu.OZ.AU
Mon Feb 25 16:33:20 AEDT 2002
For review by anyone.
compiler/*.m:
Delete the code "handling" undiscrimited unions. Their presence
slows things down, the error messages they lead to can confuse
users, and we are unlikely to ever implement them in the form
now assumed by the code.
Zoltan.
cvs diff: Diffing .
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/equiv_type.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/equiv_type.m,v
retrieving revision 1.26
diff -u -b -r1.26 equiv_type.m
--- compiler/equiv_type.m 2001/06/27 05:04:03 1.26
+++ compiler/equiv_type.m 2002/02/23 10:51:31
@@ -252,12 +252,6 @@
equiv_type__replace_in_type_2(TBody0, VarSet0, EqvMap, [TypeId],
TBody, VarSet, ContainsCirc, Info0, Info).
-equiv_type__replace_in_type_defn(_, uu_type(TBody0),
- VarSet0, EqvMap, uu_type(TBody), VarSet, no,
- Info0, Info) :-
- equiv_type__replace_in_uu(TBody0, VarSet0, EqvMap, TBody,
- VarSet, Info0, Info).
-
equiv_type__replace_in_type_defn(_, du_type(TBody0,
EqPred), VarSet0, EqvMap, du_type(TBody, EqPred),
VarSet, no, Info0, Info) :-
Index: compiler/hlds_data.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_data.m,v
retrieving revision 1.65
diff -u -b -r1.65 hlds_data.m
--- compiler/hlds_data.m 2002/02/22 01:20:41 1.65
+++ compiler/hlds_data.m 2002/02/23 03:58:01
@@ -297,7 +297,6 @@
bool, % is this type an enumeration?
maybe(sym_name) % user-defined equality pred
)
- ; uu_type(list(type)) % not yet implemented!
; eqv_type(type)
; foreign_type(
bool, % is the type already boxed
Index: compiler/hlds_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_out.m,v
retrieving revision 1.274
diff -u -b -r1.274 hlds_out.m
--- compiler/hlds_out.m 2002/02/22 01:20:43 1.274
+++ compiler/hlds_out.m 2002/02/23 10:42:34
@@ -2714,9 +2714,6 @@
io__write_string(".\n").
-hlds_out__write_type_body(_Indent, _Tvarset, uu_type(_)) -->
- { error("hlds_out__write_type_body: undiscriminated union found") }.
-
hlds_out__write_type_body(_Indent, Tvarset, eqv_type(Type)) -->
io__write_string(" == "),
term_io__write_term(Tvarset, Type),
Index: compiler/intermod.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/intermod.m,v
retrieving revision 1.112
diff -u -b -r1.112 intermod.m
--- compiler/intermod.m 2002/02/22 01:20:47 1.112
+++ compiler/intermod.m 2002/02/23 10:42:39
@@ -1209,9 +1209,6 @@
{ Body = du_type(Ctors, _, _, MaybeEqualityPred) },
{ TypeBody = du_type(Ctors, MaybeEqualityPred) }
;
- { Body = uu_type(_) },
- { error("uu types not implemented") }
- ;
{ Body = eqv_type(EqvType) },
{ TypeBody = eqv_type(EqvType) }
;
Index: compiler/magic_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/magic_util.m,v
retrieving revision 1.17
diff -u -b -r1.17 magic_util.m
--- compiler/magic_util.m 2002/02/20 03:14:10 1.17
+++ compiler/magic_util.m 2002/02/23 10:42:45
@@ -1373,8 +1373,6 @@
magic_util__check_type_defn(du_type(Ctors, _, _, _),
Parents, Errors0, Errors) -->
list__foldl2(magic_util__check_ctor(Parents), Ctors, Errors0, Errors).
-magic_util__check_type_defn(uu_type(_), _, _, _) -->
- { error("magic_util__check_type_defn: uu_type") }.
magic_util__check_type_defn(eqv_type(_), _, _, _) -->
{ error("magic_util__check_type_defn: eqv_type") }.
magic_util__check_type_defn(abstract_type, _, Errors0, Errors) -->
Index: compiler/make_hlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/make_hlds.m,v
retrieving revision 1.400
diff -u -b -r1.400 make_hlds.m
--- compiler/make_hlds.m 2002/02/22 01:20:49 1.400
+++ compiler/make_hlds.m 2002/02/23 10:46:42
@@ -1965,17 +1965,7 @@
{ add_special_preds(Module2, TVarSet, Type, TypeId,
Body, Context, Status, Module3) },
{ module_info_set_types(Module3, Types, Module) },
- ( { Body = uu_type(_) } ->
- io__stderr_stream(StdErr),
- io__set_output_stream(StdErr, OldStream),
- prog_out__write_context(Context),
- io__write_string("Error in type declaration: \n"),
- prog_out__write_context(Context),
- io__write_string(
- " the syntax for type equivalence is `:- type t1 == t2'.\n"),
- io__set_exit_status(1),
- io__set_output_stream(OldStream, _)
- ;
+ (
% XXX we can't handle abstract exported
% polymorphic equivalence types with monomorphic
% bodies, because the compiler stuffs up the
@@ -2097,7 +2087,6 @@
convert_type_defn(du_type(Body, EqualityPred), TypeId, Globals,
du_type(Body, CtorTags, IsEnum, EqualityPred)) :-
assign_constructor_tags(Body, TypeId, Globals, CtorTags, IsEnum).
-convert_type_defn(uu_type(Body), _, _, uu_type(Body)).
convert_type_defn(eqv_type(Body), _, _, eqv_type(Body)).
convert_type_defn(abstract_type, _, _, abstract_type).
Index: compiler/mercury_to_mercury.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_to_mercury.m,v
retrieving revision 1.205
diff -u -b -r1.205 mercury_to_mercury.m
--- compiler/mercury_to_mercury.m 2002/02/20 03:14:10 1.205
+++ compiler/mercury_to_mercury.m 2002/02/23 11:02:00
@@ -1553,13 +1553,6 @@
type_defn, prog_context, io__state, io__state).
:- mode mercury_output_type_defn(in, in, in, in, in, di, uo) is det.
-mercury_output_type_defn(_VarSet, _Name, _Args, uu_type(_Body), Context) -->
- io__stderr_stream(StdErr),
- io__set_output_stream(StdErr, OldStream),
- prog_out__write_context(Context),
- io__write_string("warning: undiscriminated union types not yet supported.\n"),
- io__set_output_stream(OldStream, _).
-
mercury_output_type_defn(VarSet, Name, Args, abstract_type, Context) -->
io__write_string(":- type "),
{ construct_qualified_term(Name, Args, Context, TypeTerm) },
Index: compiler/ml_type_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_type_gen.m,v
retrieving revision 1.23
diff -u -b -r1.23 ml_type_gen.m
--- compiler/ml_type_gen.m 2002/02/18 05:21:49 1.23
+++ compiler/ml_type_gen.m 2002/02/23 10:43:23
@@ -113,8 +113,6 @@
ml_gen_type_2(eqv_type(_EqvType), _, _, _) --> []. % XXX Fixme!
% For a description of the problems with equivalence types,
% see our BABEL'01 paper "Compiling Mercury to the .NET CLR".
-ml_gen_type_2(uu_type(_), _, _, _) -->
- { error("sorry, undiscriminated union types not implemented") }.
ml_gen_type_2(du_type(Ctors, TagValues, IsEnum, MaybeEqualityPred),
ModuleInfo, TypeId, TypeDefn) -->
{ ml_gen_equality_members(MaybeEqualityPred, MaybeEqualityMembers) },
Index: compiler/module_qual.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/module_qual.m,v
retrieving revision 1.72
diff -u -b -r1.72 module_qual.m
--- compiler/module_qual.m 2002/02/08 02:26:52 1.72
+++ compiler/module_qual.m 2002/02/23 11:02:05
@@ -649,8 +649,6 @@
% (during mode analysis). That way they get full type overloading
% resolution, etc. Thus we don't module-qualify them here.
{ MaybeEqualityPred = MaybeEqualityPred0 }.
-qualify_type_defn(uu_type(Types0), uu_type(Types), Info0, Info) -->
- qualify_type_list(Types0, Types, Info0, Info).
qualify_type_defn(eqv_type(Type0), eqv_type(Type), Info0, Info) -->
qualify_type(Type0, Type, Info0, Info).
qualify_type_defn(abstract_type, abstract_type, Info, Info) --> [].
Index: compiler/prog_data.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_data.m,v
retrieving revision 1.78
diff -u -b -r1.78 prog_data.m
--- compiler/prog_data.m 2002/02/20 03:14:17 1.78
+++ compiler/prog_data.m 2002/02/23 10:46:38
@@ -742,7 +742,6 @@
:- type type_defn
---> du_type(list(constructor), maybe(equality_pred))
- ; uu_type(list(type))
; eqv_type(type)
; abstract_type.
Index: compiler/prog_io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_io.m,v
retrieving revision 1.200
diff -u -b -r1.200 prog_io.m
--- compiler/prog_io.m 2002/02/12 04:59:01 1.200
+++ compiler/prog_io.m 2002/02/23 11:02:45
@@ -1341,10 +1341,6 @@
get_maybe_equality_pred(B, Body, EqualityPred),
process_du_type(ModuleName, H, Body, EqualityPred, R).
-parse_type_decl_type(ModuleName, "=", [H, B], Condition, R) :-
- get_condition(B, Body, Condition),
- process_uu_type(ModuleName, H, Body, R).
-
parse_type_decl_type(ModuleName, "==", [H, B], Condition, R) :-
get_condition(B, Body, Condition),
process_eqv_type(ModuleName, H, Body, R).
@@ -1517,22 +1513,6 @@
list(type_param),
type_defn
).
-
- % This is for "Head = Body" (undiscriminated union) definitions.
-:- pred process_uu_type(module_name, term, term, maybe1(processed_type_body)).
-:- mode process_uu_type(in, in, in, out) is det.
-process_uu_type(ModuleName, Head, Body, Result) :-
- check_for_errors(ModuleName, Head, Body, Result0),
- process_uu_type_2(Result0, Body, Result).
-
-:- pred process_uu_type_2(maybe_functor, term, maybe1(processed_type_body)).
-:- mode process_uu_type_2(in, in, out) is det.
-process_uu_type_2(error(Error, Term), _, error(Error, Term)).
-process_uu_type_2(ok(Name, Args0), Body,
- ok(processed_type_body(Name, Args, uu_type(List)))) :-
- list__map(term__coerce, Args0, Args),
- sum_to_list(Body, List0),
- list__map(convert_type, List0, List).
%-----------------------------------------------------------------------------%
Index: compiler/recompilation_check.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/recompilation_check.m,v
retrieving revision 1.8
diff -u -b -r1.8 recompilation_check.m
--- compiler/recompilation_check.m 2002/02/23 07:30:48 1.8
+++ compiler/recompilation_check.m 2002/02/25 03:10:19
@@ -1096,7 +1096,6 @@
check_type_defn_ambiguity_with_functor(_, _, abstract_type) --> [].
check_type_defn_ambiguity_with_functor(_, _, eqv_type(_)) --> [].
-check_type_defn_ambiguity_with_functor(_, _, uu_type(_)) --> [].
check_type_defn_ambiguity_with_functor(NeedQualifier,
TypeId, du_type(Ctors, _)) -->
list__foldl(check_functor_ambiguities(NeedQualifier, TypeId),
Index: compiler/recompilation_usage.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/recompilation_usage.m,v
retrieving revision 1.4
diff -u -b -r1.4 recompilation_usage.m
--- compiler/recompilation_usage.m 2002/01/16 01:13:41 1.4
+++ compiler/recompilation_usage.m 2002/02/23 10:43:30
@@ -1023,8 +1023,6 @@
), Ctors).
recompilation_usage__find_items_used_by_type_body(eqv_type(Type)) -->
recompilation_usage__find_items_used_by_type(Type).
-recompilation_usage__find_items_used_by_type_body(uu_type(Types)) -->
- recompilation_usage__find_items_used_by_types(Types).
recompilation_usage__find_items_used_by_type_body(abstract_type) --> [].
recompilation_usage__find_items_used_by_type_body(foreign_type(_, _, _)) --> [].
Index: compiler/recompilation_version.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/recompilation_version.m,v
retrieving revision 1.12
diff -u -b -r1.12 recompilation_version.m
--- compiler/recompilation_version.m 2002/02/08 02:26:58 1.12
+++ compiler/recompilation_version.m 2002/02/23 11:03:00
@@ -247,10 +247,6 @@
% always use the body.
{ NameItem = Item },
{ BodyItem = Item }
- ;
- { Body = uu_type(_) },
- { error(
- "recompilation_version__gather_items_2: uu_type") }
),
{ TypeId = Name - list__length(Args) },
GatheredItems0 =^ gathered_items,
Index: compiler/special_pred.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/special_pred.m,v
retrieving revision 1.26
diff -u -b -r1.26 special_pred.m
--- compiler/special_pred.m 2000/10/13 13:55:57 1.26
+++ compiler/special_pred.m 2002/02/23 10:43:37
@@ -199,7 +199,6 @@
can_generate_special_pred_clauses_for_type(TypeId, Body) :-
Body \= abstract_type,
- Body \= uu_type(_),
\+ type_id_has_hand_defined_rtti(TypeId).
%-----------------------------------------------------------------------------%
Index: compiler/term_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/term_util.m,v
retrieving revision 1.16
diff -u -b -r1.16 term_util.m
--- compiler/term_util.m 2002/01/16 01:13:41 1.16
+++ compiler/term_util.m 2002/02/23 10:43:42
@@ -257,9 +257,6 @@
find_weights_for_cons_list(Constructors, TypeId, TypeParams,
Weights0, Weights)
;
- TypeBody = uu_type(_),
- error("undiscriminated union types not yet implemented")
- ;
% This type does not introduce any functors
TypeBody = eqv_type(_),
Weights = Weights0
Index: compiler/type_ctor_info.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/type_ctor_info.m,v
retrieving revision 1.20
diff -u -b -r1.20 type_ctor_info.m
--- compiler/type_ctor_info.m 2002/01/25 08:22:53 1.20
+++ compiler/type_ctor_info.m 2002/02/23 10:43:49
@@ -244,9 +244,6 @@
module_info_globals(ModuleInfo, Globals),
hlds_data__get_type_defn_body(HldsDefn, TypeBody),
(
- TypeBody = uu_type(_Alts),
- sorry(this_file, "undiscriminated union")
- ;
TypeBody = abstract_type,
TypeCtorRep = unknown,
NumFunctors = -1,
Index: compiler/unify_proc.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/unify_proc.m,v
retrieving revision 1.103
diff -u -b -r1.103 unify_proc.m
--- compiler/unify_proc.m 2002/02/12 11:47:19 1.103
+++ compiler/unify_proc.m 2002/02/23 10:44:01
@@ -761,9 +761,6 @@
unify_proc__quantify_clauses_body([H1, H2], Goal, Context,
Clauses)
;
- { TypeBody = uu_type(_) },
- { error("trying to create unify proc for uu type") }
- ;
{ TypeBody = abstract_type },
{ error("trying to create unify proc for abstract type") }
).
@@ -817,9 +814,6 @@
{ TypeBody = foreign_type(_, _, _) },
{ error("trying to create index proc for a foreign type") }
;
- { TypeBody = uu_type(_) },
- { error("trying to create index proc for uu type") }
- ;
{ TypeBody = abstract_type },
{ error("trying to create index proc for abstract type") }
).
@@ -899,9 +893,6 @@
[Res, H1, H2], Context, Goal),
unify_proc__quantify_clauses_body([Res, H1, H2], Goal, Context,
Clauses)
- ;
- { TypeBody = uu_type(_) },
- { error("trying to create compare proc for uu type") }
;
{ TypeBody = abstract_type },
{ error("trying to create compare proc for abstract type") }
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
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/graphics
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/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/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
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/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 java
cvs diff: Diffing java/library
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
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 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/structure_reuse
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/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
cvs diff: Diffing util
--------------------------------------------------------------------------
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