[m-rev.] for review: --warn-dead-procs-with-live-siblings

Peter Wang novalazy at gmail.com
Thu Dec 10 15:14:39 AEDT 2015


On Tue, 08 Dec 2015 16:41:34 +1100 (AEDT), "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> For review by anyone.
> 
> The implementation is straightforward; I am seeking
> feedback on the new option's name, meaning and its
> default value.

> Add --warn-dead-procs-with-live-siblings.
> 
> compiler/options.m:
>     Add the option, with the default being "no".
> 
> compiler/dead_proc_elim.m:
>     If a predicate has two or more procedures, and some are live and
>     some are dead, generate a warning for the dead procedures only if
>     --warn-dead-procs-with-live-siblings was given.
> 
>     The set of warnings we get with the four possible combinations
>     of the new option with the old --warn-dead-procs option are these.
> 
>     --no-warn-dead-procs, --no-warn-dead-procs-with-live-siblings:
>         No warnings at all. The default situation.
> 
>     --no-warn-dead-procs, --warn-dead-procs-with-live-siblings:
>         Cannot happen: --warn-dead-procs-with-live-siblings automatically
>         imples --warn-dead-procs.
> 
>     --warn-dead-procs, --no-warn-dead-procs-with-live-siblings:
>         Warn about all dead procedures that do NOT have any live siblings;
>         keep silent about dead procedures that DO have live siblings.
>         This is what happens if the user specifies only --warn-dead-procs.
> 
>     --warn-dead-procs, --warn-dead-procs-with-live-siblings:
>         Warn about all dead procedures, regardless of whether their siblings
>         are live. This is what happens if the user specifies
>         --warn-dead-procs-with-live-siblings, with or without specifying
>         --warn-dead-procs.

I agree with the default behaviours.

Perhaps name the option --warn-all-dead-procs instead.

> diff --git a/compiler/options.m b/compiler/options.m
> index ebbbf1f..296e91d 100644
> --- a/compiler/options.m
> +++ b/compiler/options.m
...
> @@ -3547,6 +3552,10 @@ options_help_warning -->
>          "--warn-dead-procs",
>          "\tWarn about procedures which are never called.",
>          "--no-warn-target-code",
> +        "--warn-dead-procs-with-live-siblings",
> +        "\tWarn about procedures which are never called, even if some",
> +        "\tother procedure of the same predicate or function *is* called.",
> +        "--no-warn-target-code",
>          "\tDisable warnings from the compiler used to process the",
>          "\ttarget code (e.g. gcc).",
>          "--no-warn-table-with-inline",

Delete the first --no-warn-target-code line.

Peter



More information about the reviews mailing list