RISC-V: Refine riscv_parse_arch_string
authorKito Cheng <kito.cheng@sifive.com>
Tue, 27 Oct 2020 06:38:07 +0000 (14:38 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Tue, 27 Oct 2020 08:14:29 +0000 (16:14 +0800)
commite94de06fd6077438539b2d7c18eb8fcb113bd9b6
treec86c5782dbb4c17d52b75fb56e11945c481d5350
parent7f227da3e603cffe7659d404f094e07507a993b1
RISC-V: Refine riscv_parse_arch_string

 - Generalize logic for translating arch to internal flags, this patch
   is infrastructure for supporing sub-extension parsing.

gcc/ChangeLog

* common/config/riscv/riscv-common.c (opt_var_ref_t): New.
(riscv_ext_flag_table_t): New.
(riscv_ext_flag_table): New.
(riscv_parse_arch_string): Pass gcc_options* instead of
&opts->x_target_flags only, and using riscv_arch_option_table to
setup flags.
(riscv_handle_option): Update argument for riscv_parse_arch_string.
(riscv_expand_arch): Ditto.
(riscv_expand_arch_from_cpu): Ditto.
gcc/common/config/riscv/riscv-common.c