This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] sparc: remove a sentinal


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cf80913ab894d527fe274384a8fa247278d85d03

commit cf80913ab894d527fe274384a8fa247278d85d03
Author: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
Date:   Mon Jun 27 07:38:14 2016 -0400

    sparc: remove a sentinal
    
    gas/ChangeLog:
    
    2016-07-19  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
    
    	* config/tc-sparc.c (pop_table): Remove sentinel.
    	(NUM_PERC_ENTRIES): Use ARRAY_SIZE on pop_table.
    	(md_begin): Adjust.

Diff:
---
 gas/ChangeLog         |  6 ++++++
 gas/config/tc-sparc.c | 27 +++++++++++----------------
 2 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 31da783..cf25c6f 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,11 @@
 2016-07-19  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
 
+	* config/tc-sparc.c (pop_table): Remove sentinel.
+	(NUM_PERC_ENTRIES): Use ARRAY_SIZE on pop_table.
+	(md_begin): Adjust.
+
+2016-07-19  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
+
 	* config/tc-z8k.c (newfix): Make type of type argument
 	bfd_reloc_code_real_type.
 	(apply_fix): Likewise.
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index 163a216..45b2be6 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -926,8 +926,7 @@ struct pop_entry pop_table[] =
   { "tie_ldx",		BFD_RELOC_SPARC_TLS_IE_LDX, 	F_POP_POSTFIX },
   { "tie_ld",		BFD_RELOC_SPARC_TLS_IE_LD,	F_POP_POSTFIX },
   { "tie_add",		BFD_RELOC_SPARC_TLS_IE_ADD,	F_POP_POSTFIX },
-  { "gdop",	 	BFD_RELOC_SPARC_GOTDATA_OP,	F_POP_POSTFIX },
-  { NULL, 0, 0 },
+  { "gdop",	 	BFD_RELOC_SPARC_GOTDATA_OP,	F_POP_POSTFIX }
 };
 
 /* Table of %-names that can appear in a sparc assembly program.  This
@@ -962,7 +961,7 @@ struct perc_entry
   (((sizeof (priv_reg_table) / sizeof (priv_reg_table[0])) - 1)         \
    + ((sizeof (hpriv_reg_table) / sizeof (hpriv_reg_table[0])) - 1)     \
    + ((sizeof (v9a_asr_table) / sizeof (v9a_asr_table[0])) - 1)         \
-   + ((sizeof (pop_table) / sizeof (pop_table[0])) - 1) \
+   + ARRAY_SIZE (pop_table)						\
    + 1)
 
 struct perc_entry perc_table[NUM_PERC_ENTRIES];
@@ -1117,19 +1116,15 @@ md_begin (void)
       }
 
     /* Add %-pseudo-ops.  */
-    {
-      struct pop_entry *pop;
-
-      for (pop = pop_table; pop->name; pop++)
-        {
-          struct perc_entry *p = &perc_table[entry++];
-          p->type = (pop->flags & F_POP_POSTFIX
-                     ? perc_entry_post_pop : perc_entry_imm_pop);
-          p->name = pop->name;
-          p->len = strlen (pop->name);
-          p->pop = pop;
-        }
-    }
+    for (i = 0; i < ARRAY_SIZE (pop_table); i++)
+      {
+	struct perc_entry *p = &perc_table[entry++];
+	p->type = (pop_table[i].flags & F_POP_POSTFIX
+		   ? perc_entry_post_pop : perc_entry_imm_pop);
+	p->name = pop_table[i].name;
+	p->len = strlen (pop_table[i].name);
+	p->pop = &pop_table[i];
+      }
 
     /* Last entry is the centinel.  */
     perc_table[entry].type = perc_entry_none;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]