c++: Cleanup static init generation
authorNathan Sidwell <nathan@acm.org>
Tue, 31 May 2022 20:22:06 +0000 (13:22 -0700)
committerNathan Sidwell <nathan@acm.org>
Wed, 1 Jun 2022 14:31:34 +0000 (07:31 -0700)
commitc4d702fb3c1e2f6e1bc8711da81bff59543b1b19
treea8f31d00c007495dd686b09d74ff7f6ef7a4174d
parentee21974c8ecbbaa2a1d44f2dba873f8724ed9ad4
c++: Cleanup static init generation

The static init/fini generation is showing some bitrot.  This cleans
up several places to use C++, and also take advantage of already
having checked a variable for non-nullness.

gcc/cp/
* decl2.cc (ssdf_decl): Delete global.
(start_static_storage_duration_function): Use some RAII.
(do_static_initialization_or_destruction): Likewise.
(c_parse_final_cleanups): Likewise.  Avoid rechecking 'vars'.
gcc/cp/decl2.cc