c++: optimize reshape_init
commitc8df7208864d863f58da55d42ff82663059930b1
authorJason Merrill <jason@redhat.com>
Mon, 21 Mar 2022 13:58:28 +0000 (21 09:58 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 4 May 2022 20:01:35 +0000 (4 16:01 -0400)
tree89d3874ee2e725468abbc8b12735211a6e18189b
parentc2e846b539bb932d7f68f7e6b3e401c361cc3bf3
c++: optimize reshape_init

If the index of a constructor_elt is a FIELD_DECL, the CONSTRUCTOR is
already reshaped, so we can save time and memory by returning immediately.

gcc/cp/ChangeLog:

* decl.cc (reshape_init): Shortcut already-reshaped init.
 (reshape_init_class): Assert not getting one here.
gcc/cp/decl.cc