diff options
author | Jan Beulich <jbeulich@suse.com> | 2022-10-04 09:44:44 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2022-10-04 09:44:44 +0200 |
commit | f5cb31a8ba76b5ab3fa763c642d0e8f4ac292d00 (patch) | |
tree | b13e96fb2f2839eb5f77423dd7c21ddcf75fe68e /gas | |
parent | 021205d0219a5aa55e76fd19888b9c21ff3f4f3b (diff) | |
download | gdb-f5cb31a8ba76b5ab3fa763c642d0e8f4ac292d00.zip gdb-f5cb31a8ba76b5ab3fa763c642d0e8f4ac292d00.tar.gz gdb-f5cb31a8ba76b5ab3fa763c642d0e8f4ac292d00.tar.bz2 |
RISC-V/gas: drop riscv_subsets static variable
It's fully redundant with the subset_list member of riscv_rps_as.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/config/tc-riscv.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index 98a954a..3230c5c 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -265,11 +265,10 @@ riscv_set_tso (void) elf_flags |= EF_RISCV_TSO; } -/* This linked list records all enabled extensions, which are parsed from - the architecture string. The architecture string can be set by the - -march option, the elf architecture attributes, and the --with-arch - configure option. */ -static riscv_subset_list_t *riscv_subsets = NULL; +/* The linked list hanging off of .subsets_list records all enabled extensions, + which are parsed from the architecture string. The architecture string can + be set by the -march option, the elf architecture attributes, and the + --with-arch configure option. */ static riscv_parse_subset_t riscv_rps_as = { NULL, /* subset_list, we will set it later once @@ -302,14 +301,13 @@ riscv_set_arch (const char *s) return; } - if (riscv_subsets == NULL) + if (riscv_rps_as.subset_list == NULL) { - riscv_subsets = XNEW (riscv_subset_list_t); - riscv_subsets->head = NULL; - riscv_subsets->tail = NULL; - riscv_rps_as.subset_list = riscv_subsets; + riscv_rps_as.subset_list = XNEW (riscv_subset_list_t); + riscv_rps_as.subset_list->head = NULL; + riscv_rps_as.subset_list->tail = NULL; } - riscv_release_subset_list (riscv_subsets); + riscv_release_subset_list (riscv_rps_as.subset_list); riscv_parse_subset (&riscv_rps_as, s); riscv_set_rvc (false); @@ -3986,10 +3984,9 @@ s_riscv_option (int x ATTRIBUTE_UNUSED) s = XNEW (struct riscv_option_stack); s->next = riscv_opts_stack; s->options = riscv_opts; - s->subset_list = riscv_subsets; + s->subset_list = riscv_rps_as.subset_list; riscv_opts_stack = s; - riscv_subsets = riscv_copy_subset_list (s->subset_list); - riscv_rps_as.subset_list = riscv_subsets; + riscv_rps_as.subset_list = riscv_copy_subset_list (s->subset_list); } else if (strcmp (name, "pop") == 0) { @@ -4000,11 +3997,10 @@ s_riscv_option (int x ATTRIBUTE_UNUSED) as_bad (_(".option pop with no .option push")); else { - riscv_subset_list_t *release_subsets = riscv_subsets; + riscv_subset_list_t *release_subsets = riscv_rps_as.subset_list; riscv_opts_stack = s->next; riscv_opts = s->options; - riscv_subsets = s->subset_list; - riscv_rps_as.subset_list = riscv_subsets; + riscv_rps_as.subset_list = s->subset_list; riscv_release_subset_list (release_subsets); free (s); } @@ -4505,7 +4501,7 @@ riscv_write_out_attrs (void) unsigned int i; /* Re-write architecture elf attribute. */ - arch_str = riscv_arch_str (xlen, riscv_subsets); + arch_str = riscv_arch_str (xlen, riscv_rps_as.subset_list); bfd_elf_add_proc_attr_string (stdoutput, Tag_RISCV_arch, arch_str); xfree ((void *) arch_str); |