[m-rev.] for review: fix bug #183

Peter Wang novalazy at gmail.com
Wed May 22 15:09:49 AEST 2013


On Wed, 22 May 2013 14:30:00 +1000 (EST), Julien Fischer <jfischer at opturion.com> wrote:
> diff --git a/compiler/dead_proc_elim.m b/compiler/dead_proc_elim.m
> index 121b0fd..8068aac 100644
> --- a/compiler/dead_proc_elim.m
> +++ b/compiler/dead_proc_elim.m
> @@ -906,13 +906,16 @@ dead_proc_eliminate_proc(PredId, Keep, WarnForThisProc, ProcElimInfo,
>               VeryVerbose = no
>           ),
>           map.lookup(!.ProcTable, ProcId, ProcInfo0),
> +        proc_info_get_has_any_foreign_exports(ProcInfo0, HasForeignExports),
>           (
>               WarnForThisProc = yes,
> +            HasForeignExports = no
> +        ->
>               proc_info_get_context(ProcInfo0, Context),
>               Spec = warn_dead_proc(PredId, ProcId, Context, ModuleInfo),
>               !:Specs = [Spec | !.Specs]
>           ;
> -            WarnForThisProc = no
> +            true
>           ),
>           map.delete(ProcId, !ProcTable)
>       ).

WarnForThisProc should probably be WarnForThisPred.

> diff --git a/compiler/hlds_pred.m b/compiler/hlds_pred.m
> index 933c71b..8bd7648 100644
> --- a/compiler/hlds_pred.m
> +++ b/compiler/hlds_pred.m
...
> @@ -2475,7 +2479,12 @@ attribute_list_to_attributes(Attributes, Attributes).
>                   % Is the procedure mentioned in any order-independent-state-
>                   % update pragmas? If yes, list the role of this procedure
>                   % for the each of the types in those pragmas.
> -                psi_oisu_kind_fors          :: list(oisu_pred_kind_for)
> +                psi_oisu_kind_fors          :: list(oisu_pred_kind_for),
> +
> +                % Is the procedure mentioned in any foreign_export pragma,
> +                % regardless of what the current supported foreign languages
> +                % are? 
> +                psi_has_any_foreign_exports  :: bool
>           ).

A purpose-specific type would be better.

Peter



More information about the reviews mailing list