gcc/libcc1
Nathan Sidwell 0122faae30 c++: Reorganize per-scope lambda discriminators
We currently use a per-extra-scope counter to discriminate multiple
lambdas in a particular such scope.  This is not ABI compliant.  This
patch merely refactors the existing code to make it easier to drop in
a conformant mangling -- there's no functional change here.  I rename
the LAMBDA_EXPR_DISCIMINATOR to LAMBDA_EXPR_SCOPE_ONLY_DISCRIMINATOR,
foreshadowing that there'll be a new discriminator.  To provide ABI
warnings we'll need to calculate both, and that requires some
repacking of the lambda_expr's fields.  Finally, although we end up
calling the discriminator setter and the scope recorder (nearly)
always consecutively, it's clearer to handle it as two separate
operations.  That also allows us to remove the instantiation
special-case for a null extra-scope.

	gcc/cp/
	* cp-tree.h (LAMBDA_EXPR_DISCRIMINATOR): Rename to ...
	(LAMBDA_EXPR_SCOPE_ONLY_DISCRIMINATOR): ... here.
	(struct tree_lambda_expr): Make default_capture_mode &
	discriminator_scope bitfields.
	(record_null_lambda_scope) Delete.
	(record_lambda_scope_discriminator): Declare.
	* lambda.cc (struct lambda_discriminator): New struct.
	(lambda_scope, lambda_scope_stack): Adjust types.
	(lambda_count): Delete.
	(struct tree_int): Delete.
	(start_lambda_scope, finish_lambda_scope): Adjust.
	(record_lambda_scope): Only record the scope.
	(record_lambda_scope_discriminator): New.
	* mangle.cc (write_closure_type_name): Adjust.
	* module.cc (trees_out::core_vals): Likewise,
	(trees_in::core_vals): Likewise.
	* parser.cc (cp_parser_lambda_expression): Call
	record_lambda_scope_discriminator.
	* pt.cc (tsubst_lambda_expr): Adjust record_lambda_scope caling.  Call
	record_lambda_scope_discriminator. Commonize control flow on tsubsting
	the operator function.
	libcc1/
	* libcp1plugin.cc (plugin_start_closure): Adjust.
	gcc/testsuite/
	* g++.dg/abi/lambda-sig1-17.C: New.
	* g++.dg/abi/lambda-sig1.h: New.
	* g++.dg/cpp1y/lambda-mangle-1.C: Extracted to ...
	* g++.dg/cpp1y/lambda-mangle-1.h: ... here.
	* g++.dg/cpp1y/lambda-mangle-1-11.C: New
	* g++.dg/cpp1y/lambda-mangle-1-17.C
2022-11-01 06:04:48 -04:00
..
aclocal.m4 libcc1: Enable Intel CET on Intel CET enabled host 2020-05-12 09:12:37 -07:00
callbacks.cc Update copyright years. 2022-01-03 10:42:10 +01:00
callbacks.hh Update copyright years. 2022-01-03 10:42:10 +01:00
cc1plugin-config.h.in
ChangeLog Daily bump. 2022-10-13 00:17:37 +00:00
compiler-name.hh Update copyright years. 2022-01-03 10:42:10 +01:00
compiler.cc Update copyright years. 2022-01-03 10:42:10 +01:00
compiler.hh Update copyright years. 2022-01-03 10:42:10 +01:00
configure regenerate configure files 2022-10-12 09:31:32 +02:00
configure.ac Update copyright years. 2022-01-03 10:42:10 +01:00
connection.cc Update copyright years. 2022-01-03 10:42:10 +01:00
connection.hh Update copyright years. 2022-01-03 10:42:10 +01:00
context.cc Update copyright years. 2022-01-03 10:42:10 +01:00
context.hh Update copyright years. 2022-01-03 10:42:10 +01:00
deleter.hh Update copyright years. 2022-01-03 10:42:10 +01:00
findcomp.cc Update copyright years. 2022-01-03 10:42:10 +01:00
findcomp.hh Update copyright years. 2022-01-03 10:42:10 +01:00
gdbctx.hh Update copyright years. 2022-01-03 10:42:10 +01:00
libcc1.cc Update copyright years. 2022-01-03 10:42:10 +01:00
libcc1.sym
libcc1plugin.cc c++: avoid <memory> poisoning on musl [PR106102] 2022-06-27 23:22:02 +01:00
libcc1plugin.sym
libcp1.cc Update copyright years. 2022-01-03 10:42:10 +01:00
libcp1plugin.cc c++: Reorganize per-scope lambda discriminators 2022-11-01 06:04:48 -04:00
libcp1plugin.sym
Makefile.am Update copyright years. 2022-01-03 10:42:10 +01:00
Makefile.in Darwin, libcc1: Handle hosts with mdynamic-no-pic support. 2021-08-17 20:03:56 +01:00
marshall-cp.hh Update copyright years. 2022-01-03 10:42:10 +01:00
marshall.cc Update copyright years. 2022-01-03 10:42:10 +01:00
marshall.hh Update copyright years. 2022-01-03 10:42:10 +01:00
names.cc Update copyright years. 2022-01-03 10:42:10 +01:00
names.hh Update copyright years. 2022-01-03 10:42:10 +01:00
rpc.hh Update copyright years. 2022-01-03 10:42:10 +01:00
status.hh Update copyright years. 2022-01-03 10:42:10 +01:00