aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-07-14 15:25:18 +0930
committerAlan Modra <amodra@gmail.com>2022-07-14 15:25:18 +0930
commit5f6c92298a9823335b3f857591020d6b1ec2e5d0 (patch)
tree8c7d4565bbd379077ec18d23e2342da78bba2ecb
parent00b37cc41e699faa30435fb6a302311a5ad44a3d (diff)
downloadgdb-5f6c92298a9823335b3f857591020d6b1ec2e5d0.zip
gdb-5f6c92298a9823335b3f857591020d6b1ec2e5d0.tar.gz
gdb-5f6c92298a9823335b3f857591020d6b1ec2e5d0.tar.bz2
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.
-rw-r--r--gas/config/tc-ppc.c6
-rw-r--r--gas/config/tc-ppc.h5
2 files changed, 5 insertions, 6 deletions
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index 05d8ee1..452fab1 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 480c952..de9522d 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 *);