diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2025-08-15 14:15:35 +0100 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2025-08-15 14:15:35 +0100 |
commit | 84628fdbe51da29cbe1459714eec81e0dbeecb17 (patch) | |
tree | 2cc98becec602714e31cd5ccee8fe77c6d2cdf04 /libjava/java | |
parent | b1f9ab40cbcc6ecd53a2be3e01052cee096e1a00 (diff) | |
download | gcc-84628fdbe51da29cbe1459714eec81e0dbeecb17.zip gcc-84628fdbe51da29cbe1459714eec81e0dbeecb17.tar.gz gcc-84628fdbe51da29cbe1459714eec81e0dbeecb17.tar.bz2 |
RISC-V: Allow errors to be suppressed when parsing architectures
One of Alfie's FMV patches adds a hook that, in some cases,
is used to silently query a target_version (with no diagnostics
expected). In the review, I'd suggested handling this using
a location_t *, with null meaning "suppress diagnostics":
https://gcc.gnu.org/pipermail/gcc-patches/2025-August/692113.html
This patch tries to propagate that through the RISC-V parsing code.
I realise this isn't very elegant, sorry.
I think riscv_compare_version_priority should also logically suppress
diagnostics, since it's supposed to be a pure query function. (From
that point of view, advocating for this change for Alfie's patch might
have been a bit unfair.)
gcc/
* config/riscv/riscv-protos.h
(riscv_process_target_version_attr): Change location_t argument
to location_t *.
* config/riscv/riscv-subset.h
(riscv_subset_list::riscv_subset_list): Change location_t argument
to location_t *.
(riscv_subset_list::parse): Likwise.
(riscv_subset_list::set_loc): Likewise.
(riscv_minimal_hwprobe_feature_bits): Likewise.
(riscv_subset_list::m_loc): Change type to location_t.
* common/config/riscv/riscv-common.cc
(riscv_subset_list::riscv_subset_list): Change location_t argument
to location_t *.
(riscv_subset_list::add): Suppress diagnostics when m_loc is null.
(riscv_subset_list::parsing_subset_version): Likewise.
(riscv_subset_list::parse_profiles): Likewise.
(riscv_subset_list::parse_base_ext): Likewise.
(riscv_subset_list::parse_single_std_ext): Likewise.
(riscv_subset_list::check_conflict_ext): Likewise.
(riscv_subset_list::parse_single_multiletter_ext): Likewise.
(riscv_subset_list::parse): Change location_t argument to location_t *.
(riscv_subset_list::set_loc): Likewise.
(riscv_minimal_hwprobe_feature_bits): Likewise.
(riscv_parse_arch_string): Update call accordingly.
* config/riscv/riscv-target-attr.cc
(riscv_target_attr_parser::m_loc): Change type to location_t *.
(riscv_target_attr_parser::riscv_target_attr_parser): Change
location_t argument to location_t *.
(riscv_process_one_target_attr): Likewise.
(riscv_process_target_attr): Likewise.
(riscv_process_target_version_attr): Likewise.
(riscv_target_attr_parser::parse_arch): Suppress diagnostics when
m_loc is null.
(riscv_target_attr_parser::handle_arch): Likewise.
(riscv_target_attr_parser::handle_cpu): Likewise.
(riscv_target_attr_parser::handle_tune): Likewise.
(riscv_target_attr_parser::handle_priority): Likewise.
(riscv_option_valid_attribute_p): Update call accordingly.
(riscv_option_valid_version_attribute_p): Likewise.
* config/riscv/riscv.cc (parse_features_for_version): Add a
location_t * argument.
(dispatch_function_versions): Update call accordingly.
(riscv_compare_version_priority): Likewise, suppressing diagnostics.
Diffstat (limited to 'libjava/java')
0 files changed, 0 insertions, 0 deletions