On Sun, Nov 16, 2014 at 5:59 AM, Jason Merrill <ja...@redhat.com> wrote:
> This patch implements more support for C++14 constexpr: it allows arbitrary
> modification of variables in a constexpr function, but does not currently
> handle jumping -- multiple returns, loops, switches.
>
> The approach I took for this was to just use the DECL_SAVED_TREE for a
> constexpr function as the basis for expansion rather than trying to massage
> it into a magic expression.  And now the values of local variables,
> including parameters, are kept in the values hash map that I introduced with
> the aggregate NSDMI patch.
>
> But in the presence of recursive constexpr calls we can't use the same
> PARM_DECL as a key, so we need to remap it.  Thus I've added remap_fn_body
> to tree-inline.c to unshare the entire function body and remap the parms and
> result to avoid clashes.
>
> This handles some more C++14 testcases and has no regressions on C++11
> constexpr testcases.  Support for jumps will follow soon.
>
> Tested x86_64-pc-linux-gnu and powerpc64-unknown-linux-gnu.
>
> Is the remap_fn_body function ok for trunk?

can you rename it to copy_fn please?  It really copies parameter and
result and then the body.

Ok with that change.

Thanks,
Richard.

Reply via email to