[m-rev.] for review: --dump-hlds-pred-id and --debug-opt-pred-id
Fergus Henderson
fjh at cs.mu.OZ.AU
Fri May 9 21:29:53 AEST 2003
On 09-May-2003, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> +++ compiler/handle_options.m 9 May 2003 09:47:48 -0000
> @@ -630,7 +630,18 @@
> % dump options do not print these annotations.
> globals__io_lookup_string_option(dump_hlds_options,
> DumpOptions0),
> - { string__append(DumpOptions0, AllDumpOptions, DumpOptions) },
> + { string__append(DumpOptions0, AllDumpOptions, DumpOptions1) },
> + globals__io_set_option(dump_hlds_options, string(DumpOptions1))
> + ;
> + []
> + ),
> +
> + globals__io_lookup_int_option(dump_hlds_pred_id, DumpHLDSPredId),
> + ( { DumpHLDSPredId >= 0 } ->
> + globals__io_lookup_string_option(dump_hlds_options,
> + DumpOptions2),
> + { string__replace_all(DumpOptions2, "M", "", DumpOptions3) },
> + { string__replace_all(DumpOptions3, "T", "", DumpOptions) },
> globals__io_set_option(dump_hlds_options, string(DumpOptions))
There should be a comment here explaining what this code is doing and why.
What is the meaning of the magic constants "M" and "T"?
Why do these need to be deleted from DumpOptions?
> Index: compiler/hlds_out.m
> +hlds_out__maybe_write_pred(Indent, ModuleInfo, PredTable, PredId, !IO) :-
> + globals__io_lookup_string_option(dump_hlds_options, Verbose, !IO),
> + globals__io_lookup_int_option(dump_hlds_pred_id, DumpPredId, !IO),
> + pred_id_to_int(PredId, PredIdInt),
> + map__lookup(PredTable, PredId, PredInfo),
> (
> - { PredIds0 = [PredId|PredIds] }
> + % If the user requested one predicate/function to be dumped,
> + % we dump it even if the condition of the nested if-then-else
> + % says it shouldn't be dumped, and we don't dump anything else.
> + DumpPredId > 0
s/>/>=/
> +++ compiler/optimize.m 9 May 2003 09:14:44 -0000
> @@ -95,37 +95,39 @@
...
> + ( DebugOptPredId > 0 => DebugOptPredId = PredIdInt )
> + ->
Likewise here.
Also, you didn't post any diff for doc/user_guide.texi
(although it was mentioned in the log message).
Otherwise, that looks fine.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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