Skip to content
Snippets Groups Projects
Commit 061a4e35 authored by Andrew Pinski's avatar Andrew Pinski
Browse files

passes: Remove limit on the number of params


Having a limit of 2 params for NEXT_PASS was just done because I didn't think there was
a way to handle arbitrary number of params. But I found that we can handle this
via a static const variable array (constexpr so we know it is true or false at compile time)
and just loop over the array.

Note I keep around NEXT_PASS_WITH_ARG and NEXT_PASS macros instead of always using
NEXT_PASS_WITH_ARGS macro to make sure these cases get optimized for -O0 (stage1).

Tested INSERT_PASS_AFTER/INSERT_PASS_BEFORE manually by changing config/i386/i386-passes.def's
stv lines to have a 2nd argument and checked the resuling pass-instances.def to see the NEXT_PASS_WITH_ARGS
was correctly done.

changes from v1:
* v2: Handle INSERT_PASS_AFTER/INSERT_PASS_BEFORE too.

Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

	* gen-pass-instances.awk: Remove the limit of the params.
	* pass_manager.h (NEXT_PASS_WITH_ARG2): Rename to ...
	(NEXT_PASS_WITH_ARGS): This.
	* passes.cc (NEXT_PASS_WITH_ARG2): Rename to ...
	(NEXT_PASS_WITH_ARGS): This and support more than 2 params by using
	a constexpr array.

Signed-off-by: default avatarAndrew Pinski <quic_apinski@quicinc.com>
parent 7f65f949
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment