aboutsummaryrefslogtreecommitdiff
path: root/gas/dw2gencfi.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2008-02-13 10:14:40 +0000
committerJan Beulich <jbeulich@novell.com>2008-02-13 10:14:40 +0000
commita60de03c6170ebd45927e318164e2306028df86d (patch)
tree1ffc652acac063787cee604d31310ea6542f0600 /gas/dw2gencfi.c
parent36af4ef67677fb266a52888d48fd85d7f889c050 (diff)
downloadgdb-a60de03c6170ebd45927e318164e2306028df86d.zip
gdb-a60de03c6170ebd45927e318164e2306028df86d.tar.gz
gdb-a60de03c6170ebd45927e318164e2306028df86d.tar.bz2
gas/
2008-02-13 Jan Beulich <jbeulich@novell.com> * config/tc-i386.c (allow_pseudo_reg): New. (parse_real_register): Check for NULL just once. Allow all register table entries when allow_pseudo_reg is non-zero. Don't allow any registers without type when allow_pseudo_reg is zero. (tc_x86_regname_to_dw2regnum): Replace with ... (tc_x86_parse_to_dw2regnum): ... this. (tc_x86_frame_initial_instructions): Adjust for above change. * config/tc-i386.h (tc_regname_to_dw2regnum): Remove. (tc_parse_to_dw2regnum): New. (tc_x86_regname_to_dw2regnum): Replace with ... (tc_x86_parse_to_dw2regnum): ... this. * dw2gencfi.c (tc_parse_to_dw2regnum): New, broken out of ... (cfi_parse_reg): ... this. Use tc_parse_to_dw2regnum. Adjust error handling. gas/testsuite/ 2008-02-13 Jan Beulich <jbeulich@novell.com> * gas/cfi/cfi-i386.s: Add code testing use of all registers. Fix a few comments. * gas/cfi/cfi-x86_64.s: Likewise. * gas/cfi/cfi-i386.d, gas/cfi/cfi-x86_64.d: Adjust. opcodes/ 2008-02-13 Jan Beulich <jbeulich@novell.com> * i386-gen.c (process_i386_registers): Process new fields. * i386-opc.h (reg_entry): Shrink reg_flags and reg_num to unsigned char. Add dw2_regnum and Dw2Inval. * i386-reg.tbl: Provide initializers for dw2_regnum. Add pseudo register names. * i386-tbl.h: Re-generate.
Diffstat (limited to 'gas/dw2gencfi.c')
-rw-r--r--gas/dw2gencfi.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c
index 1e8262b..d7ebf8c 100644
--- a/gas/dw2gencfi.c
+++ b/gas/dw2gencfi.c
@@ -400,13 +400,11 @@ cfi_parse_separator (void)
as_bad (_("missing separator"));
}
-static unsigned
-cfi_parse_reg (void)
+#ifndef tc_parse_to_dw2regnum
+static void
+tc_parse_to_dw2regnum(expressionS *exp)
{
- int regno;
- expressionS exp;
-
-#ifdef tc_regname_to_dw2regnum
+# ifdef tc_regname_to_dw2regnum
SKIP_WHITESPACE ();
if (is_name_beginner (*input_line_pointer)
|| (*input_line_pointer == '%'
@@ -417,18 +415,24 @@ cfi_parse_reg (void)
name = input_line_pointer;
c = get_symbol_end ();
- if ((regno = tc_regname_to_dw2regnum (name)) < 0)
- {
- as_bad (_("bad register expression"));
- regno = 0;
- }
+ exp->X_op = O_constant;
+ exp->X_add_number = tc_regname_to_dw2regnum (name);
*input_line_pointer = c;
- return regno;
}
+ else
+# endif
+ expression_and_evaluate (exp);
+}
#endif
- expression_and_evaluate (&exp);
+static unsigned
+cfi_parse_reg (void)
+{
+ int regno;
+ expressionS exp;
+
+ tc_parse_to_dw2regnum (&exp);
switch (exp.X_op)
{
case O_register:
@@ -437,9 +441,14 @@ cfi_parse_reg (void)
break;
default:
+ regno = -1;
+ break;
+ }
+
+ if (regno < 0)
+ {
as_bad (_("bad register expression"));
regno = 0;
- break;
}
return regno;