]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: Tweak constness of option-related data
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 29 Sep 2022 10:32:55 +0000 (11:32 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Thu, 29 Sep 2022 10:32:55 +0000 (11:32 +0100)
commit60dee638c8a7ae59c033868de7e7638c88b38ed2
treef28201e0da3ce9629fb953074d75fa19e8640c7a
parent13af9e9fda391f4f0566ad8f0b4d0448a7e984d0
aarch64: Tweak constness of option-related data

Some of the option structures have all-const member variables.
That doesn't seem necessary: we can just use const on the objects
that are supposed to be read-only.

Also, with the new, more C++-heavy option handling, it seems
better to use constexpr for the static data, to make sure that
we're not adding unexpected overhead.

gcc/
* common/config/aarch64/aarch64-common.cc (aarch64_option_extension)
(processor_name_to_arch, arch_to_arch_name): Remove const from
member variables.
(all_extensions, all_cores, all_architectures): Make a constexpr.
* config/aarch64/aarch64.cc (processor): Remove const from
member variables.
(all_architectures): Make a constexpr.
* config/aarch64/driver-aarch64.cc (aarch64_core_data)
(aarch64_arch_driver_info): Remove const from member variables.
(aarch64_cpu_data, aarch64_arches): Make a constexpr.
(get_arch_from_id): Return a pointer to const.
(host_detect_local_cpu): Update accordingly.
gcc/common/config/aarch64/aarch64-common.cc
gcc/config/aarch64/aarch64.cc
gcc/config/aarch64/driver-aarch64.cc