[m-rev.] for review: Fix some problems with static terms in LLDS grades.

Julien Fischer jfischer at opturion.com
Mon Apr 30 13:01:20 AEST 2018


On Mon, 30 Apr 2018, Peter Wang wrote:

> diff --git a/compiler/var_locn.m b/compiler/var_locn.m
> index 507b30cdd..54b662500 100644
> --- a/compiler/var_locn.m
> +++ b/compiler/var_locn.m
> @@ -2,6 +2,7 @@
> % vim: ft=mercury ts=4 sw=4 et
> %---------------------------------------------------------------------------%
> % Copyright (C) 2000-2012 The University of Melbourne.
> +% Copyright (C) 2013-2018 The Mercury team.
> % This file may only be copied under the terms of the GNU General
> % Public License - see the file COPYING in the Mercury distribution.
> %---------------------------------------------------------------------------%
> @@ -844,14 +845,22 @@ var_locn_assign_dynamic_cell_to_var(ModuleInfo, Var, ReserveWordAtStart, Ptag,
>             LldsComment = "Allocating heap for ",
>             RegionVarCode = empty,
>             MaybeRegionRval = no
> +        ;
> +            HowToConstruct = construct_statically,
> +            % construct_statically is not normally used in LLDS grades, but
> +            % it may be set by mark_static_terms.m to support loop invariant
> +            % hoisting.

The comment at the head of mark_static_terms would suggest that's fine.
It says that while it is mainly used by the MLDS backend other parts of
the compiler may use it.

The diff is fine.

Julien.


More information about the reviews mailing list