Aarch64: Remove aarch64_field_kind indirection
Removes the aarch64_field_kind enum and replaces it with direct use of aarch64_field structs, potentially improving readability and performance.
This patch series removes the aarch64_field_kind enum in binutils, replacing it with direct uses of aarch64_field structs. The author believes this change improves code readability and may offer a marginal performance improvement. As an interim measure, some of the aarch64_field_kind enum names are retained as macros that expand to the corresponding aarch64_field value. The author seeks feedback on this approach before fully inlining the remaining uses.
- proposer
Proposes removing the `aarch64_field_kind` enum, replacing its uses with `aarch64_field` structs for readability and potential performance gains. Retains some enum names as macros temporarily and asks for feedback on the approach.
“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.”
In Details
This series touches the aarch64-specific parts of binutils, specifically the handling of aarch64_field structs. The aarch64_field_kind enum likely provides an abstraction layer over these fields. Removing this indirection could simplify the code and potentially improve performance, but it might also introduce tighter coupling or require more code changes in the future if the structure of aarch64_field changes.
For Context
Binutils is a collection of tools used to manipulate binary files, such as executables and object code. AArch64 is the 64-bit ARM architecture. This patch series modifies the way binutils handles specific fields within AArch64 binaries. An enum is a data type that consists of a set of named integer constants, offering a way to represent a fixed, limited set of choices. A struct is structured data type. By removing the enum and operating directly on the struct, the code could become simpler and faster, although this might make the code harder to change later.