[m-rev.] diff: misc minor improvements

Zoltan Somogyi zs at csse.unimelb.edu.au
Thu Jul 16 12:48:13 AEST 2009


compiler/hlds_module.m:
	Document the dependency ordering.

compiler/llds.m:
	Print the comment giving the name of each procedure always,
	and not only when --auto-comments is enabled. This makes it
	much easier to identify procedures whose names are mangled
	by the compiler.

compiler/pred_table.m:
	Minor cleanups.

Zoltan.

cvs diff: Diffing .
Index: hlds_module.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_module.m,v
retrieving revision 1.162
diff -u -b -r1.162 hlds_module.m
--- hlds_module.m	8 Jul 2009 02:23:52 -0000	1.162
+++ hlds_module.m	14 Jul 2009 13:26:15 -0000
@@ -1393,6 +1393,8 @@
 
 :- interface.
 
+    % A dependency ordering gives the list of SCCs of the module. The list
+    % is in ascending order: the lowest SCC is first, the highest SCC is last.
 :- type dependency_ordering(T)  == list(list(T)).
 :- type dependency_ordering     == dependency_ordering(pred_proc_id).
 
@@ -1407,7 +1409,6 @@
 :- pred hlds_dependency_info_get_dependency_graph(dependency_info(T)::in,
     dependency_graph(T)::out) is det.
 
-    % XXX document whether the dependency_ordering is ascending or descending.
 :- pred hlds_dependency_info_get_dependency_ordering(dependency_info(T)::in,
     dependency_ordering(T)::out) is det.
 
Index: llds_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/llds_out.m,v
retrieving revision 1.329
diff -u -b -r1.329 llds_out.m
--- llds_out.m	12 Jan 2009 01:46:44 -0000	1.329
+++ llds_out.m	14 Jul 2009 13:26:46 -0000
@@ -1702,22 +1702,19 @@
     PredProcId = Proc ^ cproc_id,
     PredProcId = proc(_, ProcId),
     proc_id_to_int(ProcId, ModeNum),
-    (
-        PrintComments = yes,
+
         io.write_string("\n/*-------------------------------------", !IO),
         io.write_string("------------------------------------*/\n", !IO),
-        io.write_string("/* code for predicate '", !IO),
+    io.write_string("/* code for '", !IO),
         % Now that we have unused_args.m mangling predicate names,
         % we should probably demangle them here.
         io.write_string(Name, !IO),
         io.write_string("'/", !IO),
         io.write_int(Arity, !IO),
-        io.write_string(" in mode ", !IO),
+    io.write_string(" mode ", !IO),
         io.write_int(ModeNum, !IO),
-        io.write_string(" */\n", !IO)
-    ;
-        PrintComments = no
-    ),
+    io.write_string(" */\n", !IO),
+
     find_caller_label(Instrs, CallerLabel),
     find_cont_labels(Instrs, set_tree234.init, ContLabelSet),
     (
Index: pred_table.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pred_table.m,v
retrieving revision 1.11
diff -u -b -r1.11 pred_table.m
--- pred_table.m	8 Sep 2008 04:35:54 -0000	1.11
+++ pred_table.m	14 Jul 2009 13:26:54 -0000
@@ -422,16 +422,16 @@
         NewRevPredIds = [_ | _],
         PredIds = OldPredIds ++ list.reverse(NewRevPredIds)
     ),
-    !:PredicateTable = !.PredicateTable ^ old_pred_ids := PredIds,
-    !:PredicateTable = !.PredicateTable ^ new_rev_pred_ids := [].
+    !PredicateTable ^ old_pred_ids := PredIds,
+    !PredicateTable ^ new_rev_pred_ids := [].
 
 predicate_table_remove_predid(PredId, !PredicateTable) :-
     OldPredIds0 = !.PredicateTable ^ old_pred_ids,
     NewRevPredIds0 = !.PredicateTable ^ new_rev_pred_ids,
     list.delete_all(OldPredIds0, PredId, OldPredIds),
     list.delete_all(NewRevPredIds0, PredId, NewRevPredIds),
-    !:PredicateTable = !.PredicateTable ^ old_pred_ids := OldPredIds,
-    !:PredicateTable = !.PredicateTable ^ new_rev_pred_ids := NewRevPredIds.
+    !PredicateTable ^ old_pred_ids := OldPredIds,
+    !PredicateTable ^ new_rev_pred_ids := NewRevPredIds.
 
 predicate_table_remove_predicate(PredId, PredicateTable0, PredicateTable) :-
     PredicateTable0 = predicate_table(Preds0, NextPredId,
@@ -788,8 +788,8 @@
         PredIds, !PredicateTable),
     predicate_table_get_predids(NewPredIds, !PredicateTable),
     list.sort(NewPredIds, SortedNewPredIds),
-    !:PredicateTable = !.PredicateTable ^ old_pred_ids := SortedNewPredIds,
-    !:PredicateTable = !.PredicateTable ^ new_rev_pred_ids := [].
+    !PredicateTable ^ old_pred_ids := SortedNewPredIds,
+    !PredicateTable ^ new_rev_pred_ids := [].
 
 :- pred reinsert_for_restrict(partial_qualifier_info::in, pred_table::in,
     accessibility_table::in, pred_id::in,
cvs diff: Diffing notes
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list