public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Tsukasa OI <research_trasio@irq.a4lg.com>
To: Tsukasa OI <research_trasio@irq.a4lg.com>
Cc: binutils@sourceware.org
Subject: [PATCH 1/3] RISC-V: Remove a loop in the ISA parser
Date: Wed, 23 Feb 2022 10:47:22 +0900	[thread overview]
Message-ID: <a86ea82baa70769b05f0283fdaeb50ab193cae66.1645580829.git.research_trasio@irq.a4lg.com> (raw)
In-Reply-To: <cover.1645580829.git.research_trasio@irq.a4lg.com>

Since commit e601909a3287bf541c6a7d82214bb387d2c76d82 ("RISC-V: Support
to parse the multi-letter prefix in the architecture string.") changed
so that all prefixed extensions are parsed in single
riscv_parse_prefixed_ext call, a "while" loop on riscv_parse_subset
is no longer required.

bfd/ChangeLog:

	* elfxx-riscv.c (riscv_parse_subset): Remove unnecessary loop.
---
 bfd/elfxx-riscv.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index 27d06d2fa3d..329dcaed304 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -2019,14 +2019,11 @@ riscv_parse_subset (riscv_parse_subset_t *rps,
   if (p == NULL)
     return false;
 
-  /* Parse the different classes of extensions in the specified order.  */
-  while (*p != '\0')
-    {
-      p = riscv_parse_prefixed_ext (rps, arch, p);
+  /* Parse prefixed extensions.  */
+  p = riscv_parse_prefixed_ext (rps, arch, p);
 
-      if (p == NULL)
-        return false;
-    }
+  if (p == NULL)
+    return false;
 
   /* Finally add implicit extensions according to the current
      extensions.  */
-- 
2.32.0


  reply	other threads:[~2022-02-23  1:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23  1:47 [PATCH 0/3] RISC-V: Make ISA parser stricter (with code clarity improvement) Tsukasa OI
2022-02-23  1:47 ` Tsukasa OI [this message]
2022-02-25  9:10   ` [PATCH 1/3] RISC-V: Remove a loop in the ISA parser Nelson Chu
2022-02-23  1:47 ` [PATCH 2/3] RISC-V: Stricter underscore handling for ISA Tsukasa OI
2022-02-25  9:22   ` Nelson Chu
2022-02-25  9:37     ` Kito Cheng
2022-02-25 11:26       ` Andrew Waterman
2022-02-23  1:47 ` [PATCH 3/3] RISC-V: Tests for ISA string handling (underscore) Tsukasa OI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a86ea82baa70769b05f0283fdaeb50ab193cae66.1645580829.git.research_trasio@irq.a4lg.com \
    --to=research_trasio@irq.a4lg.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).