tic54x: rename typedef of struct symbol_
authorTrevor Saunders <tbsaunde+binutils@tbsaunde.org>
Thu, 19 May 2016 03:48:48 +0000 (23:48 -0400)
committerTrevor Saunders <tbsaunde+binutils@tbsaunde.org>
Mon, 23 May 2016 05:17:12 +0000 (01:17 -0400)
generic gas code has a struct symbol, and tic54x typedefs a struct to symbol.
This seems at least rather confusing, and it seems like target specific headers
shouldn't  put such generic names in the global namespace preventing other
generic code from using them.

opcodes/ChangeLog:

2016-05-23  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* tic54x-dis.c (sprint_mmr): Adjust.
* tic54x-opc.c: Likewise.

gas/ChangeLog:

2016-05-23  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-tic54x.c (tic54x_mmregs): Adjust.
(md_begin): Likewise.
(encode_condition): Likewise.
(encode_cc3): Likewise.
(encode_cc2): Likewise.
(encode_operand): Likewise.
(tic54x_undefined_symbol): Likewise.

include/ChangeLog:

2016-05-23  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* opcode/tic54x.h (struct symbol_): typedef to tic54x_symbol instead of
plain symbol.

gas/ChangeLog
gas/config/tc-tic54x.c
include/ChangeLog
include/opcode/tic54x.h
opcodes/ChangeLog
opcodes/tic54x-dis.c
opcodes/tic54x-opc.c

index 328299b1ab580c6e08a66610f1e0b42436918b6e..20c87025fbc420533d45372ae0a2449a3912b304 100644 (file)
@@ -1,3 +1,13 @@
+2016-05-23  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
+
+       * config/tc-tic54x.c (tic54x_mmregs): Adjust.
+       (md_begin): Likewise.
+       (encode_condition): Likewise.
+       (encode_cc3): Likewise.
+       (encode_cc2): Likewise.
+       (encode_operand): Likewise.
+       (tic54x_undefined_symbol): Likewise.
+
 2016-05-20  Matthew Fortune  <matthew.fortune@imgtec.com>
 
        * config/tc-mips.c (mips_cpu_info_table): Update comment.  Add
index ddda0c1b1a48cda06719b8a88d1dd27d53ea92df..3936c979a5fb957804c77c8f02d21b4687240c94 100644 (file)
@@ -2012,11 +2012,11 @@ tic54x_label (int ignored ATTRIBUTE_UNUSED)
 static void
 tic54x_mmregs (int ignored ATTRIBUTE_UNUSED)
 {
-  symbol *sym;
+  tic54x_symbol *sym;
 
   ILLEGAL_WITHIN_STRUCT ();
 
-  for (sym = (symbol *) mmregs; sym->name; sym++)
+  for (sym = (tic54x_symbol *) mmregs; sym->name; sym++)
     {
       symbolS *symbolP = symbol_new (sym->name, absolute_section,
                                     (valueT) sym->value, &zero_address_frag);
@@ -2964,7 +2964,7 @@ void
 md_begin (void)
 {
   insn_template *tm;
-  symbol *sym;
+  tic54x_symbol *sym;
   const subsym_proc_entry *subsym_proc;
   const math_proc_entry *math_proc;
   const char *hash_err;
@@ -3012,7 +3012,7 @@ md_begin (void)
                  tm->name, hash_err);
     }
   reg_hash = hash_new ();
-  for (sym = (symbol *) regs; sym->name; sym++)
+  for (sym = (tic54x_symbol *) regs; sym->name; sym++)
     {
       /* Add basic registers to the symbol table.  */
       symbolS *symbolP = symbol_new (sym->name, absolute_section,
@@ -3021,26 +3021,26 @@ md_begin (void)
       symbol_table_insert (symbolP);
       hash_err = hash_insert (reg_hash, sym->name, (char *) sym);
     }
-  for (sym = (symbol *) mmregs; sym->name; sym++)
+  for (sym = (tic54x_symbol *) mmregs; sym->name; sym++)
     hash_err = hash_insert (reg_hash, sym->name, (char *) sym);
   mmreg_hash = hash_new ();
-  for (sym = (symbol *) mmregs; sym->name; sym++)
+  for (sym = (tic54x_symbol *) mmregs; sym->name; sym++)
     hash_err = hash_insert (mmreg_hash, sym->name, (char *) sym);
 
   cc_hash = hash_new ();
-  for (sym = (symbol *) condition_codes; sym->name; sym++)
+  for (sym = (tic54x_symbol *) condition_codes; sym->name; sym++)
     hash_err = hash_insert (cc_hash, sym->name, (char *) sym);
 
   cc2_hash = hash_new ();
-  for (sym = (symbol *) cc2_codes; sym->name; sym++)
+  for (sym = (tic54x_symbol *) cc2_codes; sym->name; sym++)
     hash_err = hash_insert (cc2_hash, sym->name, (char *) sym);
 
   cc3_hash = hash_new ();
-  for (sym = (symbol *) cc3_codes; sym->name; sym++)
+  for (sym = (tic54x_symbol *) cc3_codes; sym->name; sym++)
     hash_err = hash_insert (cc3_hash, sym->name, (char *) sym);
 
   sbit_hash = hash_new ();
-  for (sym = (symbol *) status_bits; sym->name; sym++)
+  for (sym = (tic54x_symbol *) status_bits; sym->name; sym++)
     hash_err = hash_insert (sbit_hash, sym->name, (char *) sym);
 
   misc_symbol_hash = hash_new ();
@@ -3651,7 +3651,7 @@ encode_integer (tic54x_insn *insn,
 static int
 encode_condition (tic54x_insn *insn, struct opstruct *operand)
 {
-  symbol *cc = (symbol *) hash_find (cc_hash, operand->buf);
+  tic54x_symbol *cc = (tic54x_symbol *) hash_find (cc_hash, operand->buf);
   if (!cc)
     {
       as_bad (_("Unrecognized condition code \"%s\""), operand->buf);
@@ -3711,7 +3711,7 @@ encode_condition (tic54x_insn *insn, struct opstruct *operand)
 static int
 encode_cc3 (tic54x_insn *insn, struct opstruct *operand)
 {
-  symbol *cc3 = (symbol *) hash_find (cc3_hash, operand->buf);
+  tic54x_symbol *cc3 = (tic54x_symbol *) hash_find (cc3_hash, operand->buf);
   int value = cc3 ? cc3->value : operand->exp.X_add_number << 8;
 
   if ((value & 0x0300) != value)
@@ -3740,7 +3740,7 @@ encode_arx (tic54x_insn *insn, struct opstruct *operand)
 static int
 encode_cc2 (tic54x_insn *insn, struct opstruct *operand)
 {
-  symbol *cc2 = (symbol *) hash_find (cc2_hash, operand->buf);
+  tic54x_symbol *cc2 = (tic54x_symbol *) hash_find (cc2_hash, operand->buf);
 
   if (!cc2)
     {
@@ -3899,7 +3899,8 @@ encode_operand (tic54x_insn *insn, enum optype type, struct opstruct *operand)
                             0, 65535, 0xFFFF);
     case OP_SBIT:
       {
-       symbol *sbit = (symbol *) hash_find (sbit_hash, operand->buf);
+       tic54x_symbol *sbit = (tic54x_symbol *)
+         hash_find (sbit_hash, operand->buf);
        int value = is_absolute (operand) ?
          operand->exp.X_add_number : (sbit ? sbit->value : -1);
        int reg = 0;
@@ -3913,7 +3914,7 @@ encode_operand (tic54x_insn *insn, enum optype type, struct opstruct *operand)
              }
            /* Guess the register based on the status bit; "ovb" is the last
               status bit defined for st0.  */
-           if (sbit > (symbol *) hash_find (sbit_hash, "ovb"))
+           if (sbit > (tic54x_symbol *) hash_find (sbit_hash, "ovb"))
              reg = 1;
          }
        if (value == -1)
@@ -5013,22 +5014,22 @@ tic54x_define_label (symbolS *sym)
 symbolS *
 tic54x_undefined_symbol (char *name)
 {
-  symbol *sym;
+  tic54x_symbol *sym;
 
   /* Not sure how to handle predefined symbols.  */
-  if ((sym = (symbol *) hash_find (cc_hash, name)) != NULL ||
-      (sym = (symbol *) hash_find (cc2_hash, name)) != NULL ||
-      (sym = (symbol *) hash_find (cc3_hash, name)) != NULL ||
-      (sym = (symbol *) hash_find (misc_symbol_hash, name)) != NULL ||
-      (sym = (symbol *) hash_find (sbit_hash, name)) != NULL)
+  if ((sym = (tic54x_symbol *) hash_find (cc_hash, name)) != NULL ||
+      (sym = (tic54x_symbol *) hash_find (cc2_hash, name)) != NULL ||
+      (sym = (tic54x_symbol *) hash_find (cc3_hash, name)) != NULL ||
+      (sym = (tic54x_symbol *) hash_find (misc_symbol_hash, name)) != NULL ||
+      (sym = (tic54x_symbol *) hash_find (sbit_hash, name)) != NULL)
     {
       return symbol_new (name, reg_section,
                         (valueT) sym->value,
                         &zero_address_frag);
     }
 
-  if ((sym = (symbol *) hash_find (reg_hash, name)) != NULL ||
-      (sym = (symbol *) hash_find (mmreg_hash, name)) != NULL ||
+  if ((sym = (tic54x_symbol *) hash_find (reg_hash, name)) != NULL ||
+      (sym = (tic54x_symbol *) hash_find (mmreg_hash, name)) != NULL ||
       !strcasecmp (name, "a") || !strcasecmp (name, "b"))
     {
       return symbol_new (name, reg_section,
index f328d97787cd3d8141c93bca9e46bc2301e39275..4b452538640c95b93dc42de8f2691548b20d1edb 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-23  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
+
+       * opcode/tic54x.h (struct symbol_): typedef to tic54x_symbol instead of
+       plain symbol.
+
 2016-04-29  Tom Tromey  <tom@tromey.com>
 
        * dwarf2.h (enum dwarf_source_language) <DW_LANG_Rust,
index 49120de6f1cab23a221b224e178f95a5af3d1250..b0af407c9eafa3e95d03bae272bb28a4c7edb12d 100644 (file)
@@ -26,7 +26,7 @@ typedef struct _symbol
 {
   const char *name;
   unsigned short value;
-} symbol;
+} tic54x_symbol;
 
 enum optype {
   OPT = 0x8000,
@@ -152,9 +152,9 @@ typedef struct _template
 extern const insn_template tic54x_unknown_opcode;
 extern const insn_template tic54x_optab[];
 extern const insn_template tic54x_paroptab[];
-extern const symbol mmregs[], regs[];
-extern const symbol condition_codes[], cc2_codes[], status_bits[];
-extern const symbol cc3_codes[];
+extern const tic54x_symbol mmregs[], regs[];
+extern const tic54x_symbol condition_codes[], cc2_codes[], status_bits[];
+extern const tic54x_symbol cc3_codes[];
 extern const char *misc_symbols[];
 struct disassemble_info;
 extern const insn_template* tic54x_get_insn (struct disassemble_info *, 
index f3e1d211647e31a3a62bb183d98eef0c1048e55c..49822804c330e71c8676052086de1278644214cf 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-23  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
+
+       * tic54x-dis.c (sprint_mmr): Adjust.
+       * tic54x-opc.c: Likewise.
+
 2016-05-19  Alan Modra  <amodra@gmail.com>
 
        * ppc-opc.c (NSISIGNOPT): Use insert_nsi and extract_nsi.
index 804e0832646261625590a2b85f68c05ce449eb5b..e12349dd0ecb018d5039cff6d32a3f8f7edbbc89 100644 (file)
@@ -530,7 +530,7 @@ sprint_mmr (disassemble_info *info ATTRIBUTE_UNUSED,
            char buf[],
            int mmr)
 {
-  symbol *reg = (symbol *) mmregs;
+  tic54x_symbol *reg = (tic54x_symbol *) mmregs;
   while (reg->name != NULL)
     {
       if (mmr == reg->value)
index f5d489b2cde2db3b7e6bf962e511a4f6b44c4a14..3c106801d8fc2280ddb9328d38205b3be6cedc61 100644 (file)
@@ -24,7 +24,7 @@
 #include "opcode/tic54x.h"
 
 /* these are the only register names not found in mmregs */
-const symbol regs[] = {
+const tic54x_symbol regs[] = {
   { "AR0", 16 },                  { "ar0", 16 },
   { "AR1", 17 },                  { "ar1", 17 },
   { "AR2", 18 },                  { "ar2", 18 },
@@ -38,7 +38,7 @@ const symbol regs[] = {
 
 /* status bits, MM registers, condition codes, etc */
 /* some symbols are only valid for certain chips... */
-const symbol mmregs[] = {
+const tic54x_symbol mmregs[] = {
   { "IMR", 0 },                   { "imr", 0 },
   { "IFR", 1 },                   { "ifr", 1 },
   { "ST0", 6 },                   { "st0", 6 },
@@ -111,7 +111,7 @@ const symbol mmregs[] = {
   { NULL, 0},
 };
 
-const symbol condition_codes[] = {
+const tic54x_symbol condition_codes[] = {
   /* condition codes */
   { "UNC",  0 },                { "unc",  0 },
 #define CC1   0x40
@@ -155,7 +155,7 @@ const symbol condition_codes[] = {
   { NULL, 0 }
 };
 
-const symbol cc2_codes[] = {
+const tic54x_symbol cc2_codes[] = {
   { "UNC", 0 },  { "unc", 0 },
   { "AEQ", 5 },  { "aeq", 5 },
   { "ANEQ", 4 }, { "aneq", 4 },
@@ -172,7 +172,7 @@ const symbol cc2_codes[] = {
   { NULL, 0 },
 };
 
-const symbol cc3_codes[] = {
+const tic54x_symbol cc3_codes[] = {
   { "EQ", 0x0000 },  { "eq", 0x0000 },
   { "LT", 0x0100 },  { "lt", 0x0100 },
   { "GT", 0x0200 },  { "gt", 0x0200 },
@@ -189,7 +189,7 @@ const symbol cc3_codes[] = {
 };
 
 /* FIXME -- also allow decimal digits */
-const symbol status_bits[] = {
+const tic54x_symbol status_bits[] = {
   /* status register 0 */
   { "TC",  12 },                { "tc",  12 },
   { "C",   11 },                { "c",   11 },
This page took 0.036749 seconds and 4 git commands to generate.