[PATCH 0/5] aarch64: Remove aarch64_field_kind indirection
Richard Earnshaw (foss)
Richard.Earnshaw@arm.com
Fri May 29 15:00:14 GMT 2026
On 20/05/2026 13:08, Alice Carlotti wrote:
> This patch series remove the aarch64_field_kind enum, and replaces uses of the
> enum with direct use of aarch64_field structs instead. I think this improves
> readability overall, and might also be a marginal performance improvement.
>
> Passing aarch64_field as function arguments causes GCC to emit this note:
>
> note: parameter passing for argument of type ‘aarch64_field’
> {aka ‘struct aarch64_field’} changed in GCC 9.1
That depends on which files generate this warning. Does this function form part of an API that would be exported if/when libopcodes is made into an installed library?
If not, then we probably don't care. We also don't care if it only occurs when this is used as part of the code used to build the auto-generated code.
I think there's an option to gcc to suppress the warning (-Wabi?). Perhaps one way to suppress the warning would be with a pragma; that would be preferable to disabling it on the command line, since that might lead to other cases that do matter not being reported.
>
> Is this a problem? Should I find some way to avoid this note being emitted?
>
>
> As an interim measure, I've retained some of the aarch64_field_kind enum names
> as macros that expand to corresponding the aarch64_field value. I've
> deliberately chosen not to inline all of these remaining uses immediately, as
> in many cases I intend to either add comments or rework the surrounding code
> first. After this patch series, there would be 76 macros remaining (not
> counting the FLD_CONST_* macros), out of 216 original enum values.
>
>
> Does this approach look ok?
>
> Thanks,
> Alice
R.
More information about the Binutils
mailing list