[art] fix -Wreorder-init-list for jvmtiEventCallbacks
C++2a adds support for designated initialization, but would like member
order to match that of the aggregate definition (due to side effects of
the expressions in the designated initializer).
The FOR_ALL_SUPPORTED_EVENTS macro is implemented in terms of the
FOR_ALL_SUPPORTED_JNI_EVENTS and FOR_ALL_SUPPORTED_NO_JNI_EVENTS macros
that clearly delineate between which members of jvmtiEventCallbacks have
JNI events or not.
The declaration of this struct intersperses the members with this
distinction. We can reorder the JNI events, but we still have a problem
with FOR_ALL_SUPPORTED_EVENTS which would try to intersperse them in the
wrong order.
It seems that the `fun` macro parameter only differs for
GENERATE_LOG_FUNCTION_{NO_}JNI. We can change the
FOR_ALL_SUPPORTED_JNI_EVENTS macro to accept 2 functions, one for JNI
events, and one for non-JNI events. We can then order the members
correctly, and specify differing arguments at the macro expansion sites
(of FOR_ALL_SUPPORTED_JNI_EVENTS) if needed, otherwise we can specify
the same parameter twice (small price to pay for member order).
Bug: 139945549
Test: mm
Change-Id: I4636b0b08747fe63c8f68e87bd24e4a38d58ffff
1 file changed