[m-rev.] diff: obsolete bintree_set
Julien Fischer
juliensf at cs.mu.OZ.AU
Mon Mar 27 11:58:55 AEDT 2006
Estimated hours taken: 0.5
Branches: main
Add obsolete pragmas to the interface of bintree_set.
library/bintree_set.m:
Add obsolete pragmas to the procedures in the interface of this
module; the documentation has said they are obsolete for a very long
time.
library/Mmakefile:
Avoid warnings about calls to obsolete pragmas within bintree_set.
compiler/llds_out.m:
Replaces usage of bintree_set with set_tree234, since the former is
obsolete.
Julien.
Index: compiler/llds_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/llds_out.m,v
retrieving revision 1.273
diff -u -r1.273 llds_out.m
--- compiler/llds_out.m 22 Mar 2006 02:56:12 -0000 1.273
+++ compiler/llds_out.m 24 Mar 2006 06:07:04 -0000
@@ -203,7 +203,6 @@
:- import_module parse_tree.prog_util.
:- import_module assoc_list.
-:- import_module bintree_set.
:- import_module char.
:- import_module deconstruct.
:- import_module dir.
@@ -1347,13 +1346,13 @@
),
find_caller_label(Instrs, CallerLabel),
- find_cont_labels(Instrs, bintree_set.init, ContLabelSet),
+ find_cont_labels(Instrs, set_tree234.init, ContLabelSet),
(
EmitCLoops = yes,
- find_while_labels(Instrs, bintree_set.init, WhileSet)
+ find_while_labels(Instrs, set_tree234.init, WhileSet)
;
EmitCLoops = no,
- WhileSet = bintree_set.init
+ WhileSet = set_tree234.init
),
output_instruction_list(Instrs, PrintComments,
CallerLabel - ContLabelSet, WhileSet, !IO).
@@ -1382,7 +1381,7 @@
% nondet disjunctions, forks or joins, and store them in ContLabelSet.
%
:- pred find_cont_labels(list(instruction)::in,
- bintree_set(label)::in, bintree_set(label)::out) is det.
+ set_tree234(label)::in, set_tree234(label)::out) is det.
find_cont_labels([], !ContLabelSet).
find_cont_labels([Instr - _ | Instrs], !ContLabelSet) :-
@@ -1398,12 +1397,11 @@
Const = code_addr_const(label(ContLabel))
)
->
- bintree_set.insert(!.ContLabelSet, ContLabel, !:ContLabelSet)
+ set_tree234.insert(ContLabel, !ContLabelSet)
;
Instr = fork(Label1, Label2, _)
->
- bintree_set.insert_list(!.ContLabelSet, [Label1, Label2],
- !:ContLabelSet)
+ set_tree234.insert_list([Label1, Label2], !ContLabelSet)
;
Instr = block(_, _, Block)
->
@@ -1432,7 +1430,7 @@
% The second of these is better if we don't have fast jumps.
%
:- pred find_while_labels(list(instruction)::in,
- bintree_set(label)::in, bintree_set(label)::out) is det.
+ set_tree234(label)::in, set_tree234(label)::out) is det.
find_while_labels([], !WhileSet).
find_while_labels([Instr0 - _ | Instrs0], !WhileSet) :-
@@ -1441,7 +1439,7 @@
is_while_label(Label, Instrs0, Instrs1, 0, UseCount),
UseCount > 0
->
- bintree_set.insert(!.WhileSet, Label, !:WhileSet),
+ set_tree234.insert(Label, !WhileSet),
find_while_labels(Instrs1, !WhileSet)
;
find_while_labels(Instrs0, !WhileSet)
@@ -1624,7 +1622,7 @@
%-----------------------------------------------------------------------------%
:- pred output_instruction_list(list(instruction)::in, bool::in,
- pair(label, bintree_set(label))::in, bintree_set(label)::in,
+ pair(label, set_tree234(label))::in, set_tree234(label)::in,
io::di, io::uo) is det.
output_instruction_list([], _, _, _, !IO).
@@ -1634,7 +1632,7 @@
!IO),
(
Instr0 = label(Label),
- bintree_set.is_member(Label, WhileSet)
+ set_tree234.contains(WhileSet, Label)
->
io.write_string("\twhile (1) {\n", !IO),
output_instruction_list_while(Instrs, Label,
@@ -1648,7 +1646,7 @@
).
:- pred output_instruction_list_while(list(instruction)::in, label::in,
- bool::in, pair(label, bintree_set(label))::in, bintree_set(label)::in,
+ bool::in, pair(label, set_tree234(label))::in, set_tree234(label)::in,
io::di, io::uo) is det.
output_instruction_list_while([], _, _, _, _, !IO) :-
@@ -1693,7 +1691,7 @@
).
:- pred output_instruction_list_while_block(list(instruction)::in, label::in,
- bool::in, pair(label, bintree_set(label))::in, io::di, io::uo) is det.
+ bool::in, pair(label, set_tree234(label))::in, io::di, io::uo) is det.
output_instruction_list_while_block([], _, _, _, !IO).
output_instruction_list_while_block([Instr0 - Comment0 | Instrs], Label,
@@ -1730,7 +1728,7 @@
).
:- pred output_instruction_and_comment(instr::in, string::in, bool::in,
- pair(label, bintree_set(label))::in, io::di, io::uo) is det.
+ pair(label, set_tree234(label))::in, io::di, io::uo) is det.
output_instruction_and_comment(Instr, Comment, PrintComments, ProfInfo, !IO) :-
(
@@ -1760,7 +1758,7 @@
% Normally we use output_instruction_and_comment/6.
%
output_debug_instruction_and_comment(Instr, Comment, PrintComments, !IO) :-
- bintree_set.init(ContLabelSet),
+ ContLabelSet = set_tree234.init,
DummyModule = unqualified("DEBUG"),
DummyPredName = "DEBUG",
proc_id_to_int(hlds_pred.initial_proc_id, InitialProcIdInt),
@@ -1774,7 +1772,7 @@
% Normally we use output_instruction/4.
%
output_debug_instruction(Instr, !IO) :-
- bintree_set.init(ContLabelSet),
+ ContLabelSet = set_tree234.init,
DummyModule = unqualified("DEBUG"),
DummyPredName = "DEBUG",
proc_id_to_int(hlds_pred.initial_proc_id, InitialProcIdInt),
@@ -1807,7 +1805,7 @@
output_block_end(!IO) :-
io.write_string("\t}\n", !IO).
-:- pred output_instruction(instr::in, pair(label, bintree_set(label))::in,
+:- pred output_instruction(instr::in, pair(label, set_tree234(label))::in,
io::di, io::uo) is det.
output_instruction(comment(Comment), _, !IO) :-
@@ -1823,7 +1821,7 @@
output_block_start(TempR, TempF, !IO),
globals.io_lookup_bool_option(auto_comments, PrintComments, !IO),
output_instruction_list(Instrs, PrintComments, ProfInfo,
- bintree_set.init, !IO),
+ set_tree234.init, !IO),
output_block_end(!IO).
output_instruction(assign(Lval, Rval), _, !IO) :-
@@ -3353,14 +3351,14 @@
%-----------------------------------------------------------------------------%
:- pred maybe_output_update_prof_counter(label::in,
- pair(label, bintree_set(label))::in, io::di, io::uo) is det.
+ pair(label, set_tree234(label))::in, io::di, io::uo) is det.
maybe_output_update_prof_counter(Label, CallerLabel - ContLabelSet, !IO) :-
% If ProfileTime is no, the definition of MR_update_prof_current_proc
% is empty anyway.
globals.io_lookup_bool_option(profile_time, ProfileTime, !IO),
(
- bintree_set.is_member(Label, ContLabelSet),
+ set_tree234.member(ContLabelSet, Label),
ProfileTime = yes
->
io.write_string("\tMR_update_prof_current_proc(MR_LABEL_AP(", !IO),
Index: library/Mercury.options
===================================================================
RCS file: /home/mercury1/repository/mercury/library/Mercury.options,v
retrieving revision 1.12
diff -u -r1.12 Mercury.options
--- library/Mercury.options 14 Mar 2006 05:55:26 -0000 1.12
+++ library/Mercury.options 25 Mar 2006 12:38:15 -0000
@@ -21,6 +21,9 @@
MCFLAGS-dir += --no-halt-at-warn
MCFLAGS-exception += --no-halt-at-warn
+# We need a better way to ignore obsolete procedures.
+MCFLAGS-bintree_set += --no-halt-at-warn
+
# io.m uses library features that are supported by POSIX but which are not
# part of ANSI C, such as `struct stat', fileno(), and putenv().
# We need to pass --no-ansi to mgnuc to ensure that these are declared.
Index: library/bintree_set.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/bintree_set.m,v
retrieving revision 1.25
diff -u -r1.25 bintree_set.m
--- library/bintree_set.m 7 Mar 2006 22:23:42 -0000 1.25
+++ library/bintree_set.m 25 Mar 2006 12:31:34 -0000
@@ -30,75 +30,94 @@
% `bintree_set.list_to_set(List, Set)' is true iff `Set' is the set
% containing only the members of `List'.
%
+:- pragma obsolete(bintree_set.list_to_set/2).
:- pred bintree_set.list_to_set(list(T)::in, bintree_set(T)::out) is det.
+:- pragma obsolete(bintree_set.list_to_set/1).
:- func bintree_set.list_to_set(list(T)) = bintree_set(T).
% `bintree_set.sorted_list_to_set(List, Set)' is true iff `Set' is the set
% containing only the members of `List'. `List' must be sorted.
%
+:- pragma obsolete(bintree_set.sorted_list_to_set/2).
:- pred bintree_set.sorted_list_to_set(list(T)::in, bintree_set(T)::out)
is det.
+:- pragma obsolete(bintree_set.sorted_list_to_set/1).
:- func bintree_set.sorted_list_to_set(list(T)) = bintree_set(T).
% `bintree_set.list_to_bintree_set(Set, List)' is true iff `List' is
% the list of all the members of `Set', in sorted order.
%
+:- pragma obsolete(bintree_set.to_sorted_list/2).
:- pred bintree_set.to_sorted_list(bintree_set(T)::in, list(T)::out) is det.
+:- pragma obsolete(bintree_set.to_sorted_list/1).
:- func bintree_set.to_sorted_list(bintree_set(T)) = list(T).
% `bintree_set.init(Set)' is true iff `Set' is an empty set.
%
+:- pragma obsolete(bintree_set.init/1).
:- pred bintree_set.init(bintree_set(T)::uo) is det.
+:- pragma obsolete(bintree_set.init/0).
:- func bintree_set.init = bintree_set(T).
+:- pragma obsolete(bintree_set.singleton_set/2).
:- pred bintree_set.singleton_set(bintree_set(T)::out, T::in) is det.
% `bintree_set.equal(SetA, SetB)' is true iff `SetA' and `SetB'
% contain the same elements.
%
+:- pragma obsolete(bintree_set.equal/2).
:- pred bintree_set.equal(bintree_set(T)::in, bintree_set(T)::in) is semidet.
% `bintree_set.subset(SetA, SetB)' is true iff `SetA' is a subset
% of `SetB'.
%
+:- pragma obsolete(bintree_set.subset/2).
:- pred bintree_set.subset(bintree_set(T)::in, bintree_set(T)::in) is semidet.
% `bintree_set.superset(SetA, SetB)' is true iff `SetA' is a superset
% of `SetB'.
%
+:- pragma obsolete(bintree_set.superset/2).
:- pred bintree_set.superset(bintree_set(T)::in, bintree_set(T)::in)
is semidet.
% `bintree_set_member(X, Set)' is true iff `X' is a member of `Set'.
%
+:- pragma obsolete(bintree_set.member/2).
:- pred bintree_set.member(T, bintree_set(T)).
:- mode bintree_set.member(in, in) is semidet.
:- mode bintree_set.member(out, in) is nondet.
% `bintree_set.is_member(X, Set)' is true iff `X' is a member of `Set'.
%
+:- pragma obsolete(bintree_set.is_member/2).
:- pred bintree_set.is_member(T::in, bintree_set(T)::in) is semidet.
% `bintree_set.contains(Set, X)' is true iff `X' is a member of `Set'.
%
+:- pragma obsolete(bintree_set.contains/2).
:- pred bintree_set.contains(bintree_set(T)::in, T::in) is semidet.
% `bintree_set.insert(Set0, X, Set)' is true iff `Set' is the union of
% `Set0' and the set containing only `X'.
%
+:- pragma obsolete(bintree_set.insert/3).
:- pred bintree_set.insert(bintree_set(T), T, bintree_set(T)).
:- mode bintree_set.insert(di, di, uo) is det.
:- mode bintree_set.insert(in, in, out) is det.
+:- pragma obsolete(bintree_set.insert/2).
:- func bintree_set.insert(bintree_set(T), T) = bintree_set(T).
% `bintree_set.insert_list(Set0, Xs, Set)' is true iff `Set' is the union
% of `Set0' and the set containing only the members of `Xs'.
%
+:- pragma obsolete(bintree_set.insert_list/3).
:- pred bintree_set.insert_list(bintree_set(T), list(T), bintree_set(T)).
:- mode bintree_set.insert_list(di, di, uo) is det.
:- mode bintree_set.insert_list(in, in, out) is det.
+:- pragma obsolete(bintree_set.insert_list/2).
:- func bintree_set.insert_list(bintree_set(T), list(T)) = bintree_set(T).
% `bintree_set.remove(Set0, X, Set)' is true iff `Set0' contains `X',
@@ -106,6 +125,7 @@
% only `X', i.e. if `Set' is the set which contains all the elements
% of `Set0' except `X'.
%
+:- pragma obsolete(bintree_set.remove/3).
:- pred bintree_set.remove(bintree_set(T), T, bintree_set(T)).
:- mode bintree_set.remove(in, in, out) is semidet.
% The following mode could be implemented, but hasn't been:
@@ -116,6 +136,7 @@
% the relative complement of `Set0' and the set containing only the
% members of `Xs'.
%
+:- pragma obsolete(bintree_set.remove_list/3).
:- pred bintree_set.remove_list(bintree_set(T)::in, list(T)::in,
bintree_set(T)::out) is semidet.
@@ -123,31 +144,40 @@
% complement of `Set0' and the set containing only `X', i.e. if `Set'
% is the set which contains all the elements of `Set0' except `X'.
%
+:- pragma obsolete(bintree_set.delete/3).
:- pred bintree_set.delete(bintree_set(T)::in, T::in, bintree_set(T)::out)
is det.
+:- pragma obsolete(bintree_set.delete/2).
:- func bintree_set.delete(bintree_set(T), T) = bintree_set(T).
% `bintree_set.delete_list(Set0, Xs, Set)' is true iff `Set' is the
% relative complement of `Set0' and the set containing only the members
% of `Xs'.
%
+:- pragma obsolete(bintree_set.delete_list/3).
:- pred bintree_set.delete_list(bintree_set(T)::in, list(T)::in,
bintree_set(T)::out) is det.
+
+:- pragma obsolete(bintree_set.delete_list/2).
:- func bintree_set.delete_list(bintree_set(T), list(T)) = bintree_set(T).
% `set_union(SetA, SetB, Set)' is true iff `Set' is the union of
% `SetA' and `SetB'. If the sets are known to be of different sizes,
% then for efficiency make `SetA' the larger of the two.
%
+:- pragma obsolete(bintree_set.union/3).
:- pred bintree_set.union(bintree_set(T)::in, bintree_set(T)::in,
bintree_set(T)::out) is det.
+:- pragma obsolete(bintree_set.union/2).
:- func bintree_set.union(bintree_set(T), bintree_set(T)) = bintree_set(T).
% `set_intersect(SetA, SetB, Set)' is true iff `Set' is the
% intersection of `SetA' and `SetB'.
%
+:- pragma obsolete(bintree_set.intersect/3).
:- pred bintree_set.intersect(bintree_set(T)::in, bintree_set(T)::in,
bintree_set(T)::out) is det.
+:- pragma obsolete(bintree_set.intersect/2).
:- func bintree_set.intersect(bintree_set(T), bintree_set(T))
= bintree_set(T).
--------------------------------------------------------------------------
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