c++: Static init guard generation
authorNathan Sidwell <nathan@acm.org>
Wed, 1 Jun 2022 11:52:21 +0000 (04:52 -0700)
committerNathan Sidwell <nathan@acm.org>
Wed, 1 Jun 2022 14:43:59 +0000 (07:43 -0700)
commit289f860fe62423a66e43989688e1d24bcdb25b5e
treeee71bc733bf385e7a159681baff6e45bb6fb0f8e
parentc4d702fb3c1e2f6e1bc8711da81bff59543b1b19
c++: Static init guard generation

The guard generation for a static var init was overly verbose.  We can
use a bit of RAII and avoid some rechecking.  Also in the !cxa_atexit
case, the only difference is whether can become whether to use
post-inc or pre-dec.

gcc/cp/
* decl2.cc (fix_temporary_vars_context_r): Use data argument
for new context.
(one_static_initialization_or_destruction): Adjust tree walk
call.  Refactor guard generation.
gcc/cp/decl2.cc