From: Alan Modra Date: Thu, 14 Jul 2022 05:55:18 +0000 (+0930) Subject: Re: PowerPC: implement md_operand to parse register names X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5f6c92298a9823335b3f857591020d6b1ec2e5d0;p=binutils-gdb.git 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 --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 *);