[ABI PATCH] static anonymous unions of function scope
authorNathan Sidwell <nathan@acm.org>
Thu, 1 Nov 2018 11:18:06 +0000 (11:18 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Thu, 1 Nov 2018 11:18:06 +0000 (11:18 +0000)
commit41f927f4a668aeb167a673f916cc5cbfb978a560
tree9677b9701960270615e3bd8fae450f03f8400509
parent5de9d93189dd367bd3d2e1430d3aefdccab5cb72
[ABI PATCH] static anonymous unions of function scope

https://gcc.gnu.org/ml/gcc-patches/2018-10/msg02076.html
* cp-tree.h (struct lang_function): Delete x_local_names field.
(struct lang_decl_base): Rename u2sel to spare.
(struct lang_decl_min): Remove lang_decl_u2 union.  Keep access
field.
(LANG_DECL_U2_CHECK): Delete.
(DECL_DISCRIMINATOR_P): Require function scope.
(DECL_DISCRIMINATOR): Adjust.
(DECL_DISCRIMINATOR_SET_P): Delete.
(DECL_CAPTURED_VARIABLE, DECL_ACCESS, THUnK_VIRTUAL_OFFSET): Adjust.
(local_classes): Don't declare.
(determine_local_discriminator): Declare.
* decl.c (push_local_name): Delete.
(local_entities, determina_local_discrminator): New.
(duplicate_decls): Copy DECL_ACCESS. Fix formatting.
(cp_finish_decl): Use determine_local_discriminator.
(save_function_data): Drop x_local_names.
(finish_function): Drop local_names.
* decl2.c (finish_anon_union): Use determine_local_disciminator.
* mangle.c (write_unnamed_type_name): Use
discriminator_for_local_entity.
(local_class_index): Delete.
(discriminator_for_local_entity): Reimplement.
(write_local_name): Adjust discriminator code.
* name-lookup.c (do_pushtag): Call determine_local_discrimiator.
* semantics.c (finish_omp_threadprivate): Drop DECL_DISCRIMINATOR
handling.
* class.c (local_classes): Delete.
(init_class_processing): Don't init it.

* g++.dg/abi/anon5.C: New.

From-SVN: r265714
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/mangle.c
gcc/cp/name-lookup.c
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/abi/anon5.C [new file with mode: 0644]