[PATCH v2 11/16] RISC-V: riscv_parse_subset_t's isa_spec is only parser input

Project / Subsystem

binutils / risc-v

Date

2026-05-15

Proposer

Jan Beulich <jbeulich@suse.com>

Source type

public_inbox

Consensus

Ready to Land

Sentiment

/10

Technical tradeoffs

  • Improved code clarity by marking a field as const.
  • Potential for compiler optimizations due to const annotation.

All attributes

project
binutils
subsystem
risc-v
patch_id
discussion_id
34971eef-60d6-402e-bf4e-33259d13e09c@suse.com
source_type
public_inbox
title
[PATCH v2 11/16] RISC-V: riscv_parse_subset_t's isa_spec is only parser input
headline
RISC-V: riscv_parse_subset_t's isa_spec is only parser input
tldr
Makes the `isa_spec` field in `riscv_parse_subset_t` const to clarify that it's an input-only value for parsing RISC-V ISA subsets.
proposer
Jan Beulich <jbeulich@suse.com>
consensus
Ready to Land
outcome
ready
sentiment_score
technical_tradeoffs
  • Improved code clarity by marking a field as const.
  • Potential for compiler optimizations due to const annotation.
series_id
binutils:risc-v: riscv_parse_subset_t's isa_spec is only parser input
series_role
reply
series_parts
[]
tags
  • risc-v
  • parsing
  • ISA
  • code clarity
  • const correctness
bugzilla_url
date
2026-05-15T00:00:00.000Z

[PATCH v2 11/16] RISC-V: riscv_parse_subset_t's isa_spec is only parser input

This patch modifies the riscv_parse_subset_t structure to make the isa_spec field a pointer to a const enum riscv_spec_class. This change clarifies that the isa_spec field is only used as input during parsing and is not modified. The patch also removes an unnecessary indirection in riscv_get_default_ext_version(). Reviewers have approved the patch.