On 6/12/25 11:00 AM, Alfie Richards wrote:
This is a quick refactor of the riscv target processing code
to take a string_slice rather than a decl.

The reason for this is to enable it to work with target_clones
where merging logic requires reasoning about each version string
individually in the front end.

This refactor primarily serves just to get this working. Ideally the
logic here would be further refactored as currently there is no way to
check if a parse fails or not without emitting an error.
This makes things difficult for later patches which intends to emit a
warning and ignoring unrecognised/not parsed target_clone values rather
than erroring which can't currently be achieved with the current riscv
code.

gcc/ChangeLog:

        * config/riscv/riscv-protos.h (riscv_process_target_version_str): New 
function..
        * config/riscv/riscv-target-attr.cc (riscv_process_target_attr): 
Refactor to take
        string_slice.
        (riscv_process_target_version_str): Ditto.
        * config/riscv/riscv.cc (parse_features_for_version): Refactor to take
        string_slice.
        (riscv_compare_version_priority): Ditto.
        (dispatch_function_versions): Change to pass location.
OK.

jeff

Reply via email to