public inbox for binutils-cvs@sourceware.org help / color / mirror / Atom feed
From: Alan Modra <amodra@sourceware.org> To: bfd-cvs@sourceware.org Subject: [binutils-gdb] Re: PowerPC: implement md_operand to parse register names Date: Thu, 14 Jul 2022 06:03:50 +0000 (GMT) [thread overview] Message-ID: <20220714060350.03CA5385C415@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5f6c92298a9823335b3f857591020d6b1ec2e5d0 commit 5f6c92298a9823335b3f857591020d6b1ec2e5d0 Author: Alan Modra <amodra@gmail.com> Date: Thu Jul 14 15:25:18 2022 +0930 Re: PowerPC: implement md_operand to parse register names I meant to make this change before committing, to let compilers know the code on the false branch of md_parse_name is dead. * config/tc-ppc.c (ppc_parse_name): Return void. * config/tc-ppc.h (md_parse_name): Always true. (ppc_parse_name): Update prototype. Diff: --- gas/config/tc-ppc.c | 6 ++---- gas/config/tc-ppc.h | 5 +++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 05d8ee19be7..452fab1cbfc 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -862,7 +862,7 @@ static const struct pd_reg cr_cond[] = to use for condition codes, and recognises other registers when -mregnames. */ -int +void ppc_parse_name (const char *name, expressionS *exp, enum expr_mode mode) { const struct pd_reg *reg = NULL; @@ -877,7 +877,7 @@ ppc_parse_name (const char *name, expressionS *exp, enum expr_mode mode) exp->X_op = O_register; exp->X_add_number = reg->value; exp->X_md = reg->flags; - return true; + return; } /* The following replaces code in expr.c operand() after the @@ -909,8 +909,6 @@ ppc_parse_name (const char *name, expressionS *exp, enum expr_mode mode) exp->X_add_symbol = sym; exp->X_add_number = 0; } - - return true; } /* Propagate X_md and check register expressions. This is to support diff --git a/gas/config/tc-ppc.h b/gas/config/tc-ppc.h index 480c952be45..de9522d4bf6 100644 --- a/gas/config/tc-ppc.h +++ b/gas/config/tc-ppc.h @@ -322,8 +322,9 @@ extern void ppc_frob_label (symbolS *); /* call md_pcrel_from_section, not md_pcrel_from */ #define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section(FIX, SEC) -#define md_parse_name(name, exp, mode, c) ppc_parse_name (name, exp, mode) -extern int ppc_parse_name (const char *, struct expressionS *, enum expr_mode); +#define md_parse_name(name, exp, mode, c) \ + (ppc_parse_name (name, exp, mode), true) +extern void ppc_parse_name (const char *, struct expressionS *, enum expr_mode); #define md_optimize_expr(left, op, right) ppc_optimize_expr (left, op, right) extern int ppc_optimize_expr (expressionS *, operatorT, expressionS *);
reply other threads:[~2022-07-14 6:03 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220714060350.03CA5385C415@sourceware.org \ --to=amodra@sourceware.org \ --cc=bfd-cvs@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: linkBe 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).