gas/
[deliverable/binutils-gdb.git] / gas / config / tc-score7.c
index 30b1128a6eb949aedca237288eb762a442fcede3..b21ec521053e2515ba6f83665c04e19c8a7e90d2 100644 (file)
@@ -597,7 +597,7 @@ static struct s7_datafield_range s7_score_df_range[] =
 struct s7_asm_opcode
 {
   /* Instruction name.  */
-  const char *template;
+  const char *template_name;
 
   /* Instruction Opcode.  */
   bfd_vma value;
@@ -2620,7 +2620,7 @@ s7_get_insn_class_from_type (enum score_insn_type type)
 }
 
 static unsigned long
-s7_adjust_paritybit (unsigned long m_code, enum insn_class class)
+s7_adjust_paritybit (unsigned long m_code, enum insn_class i_class)
 {
   unsigned long result = 0;
   unsigned long m_code_high = 0;
@@ -2628,22 +2628,22 @@ s7_adjust_paritybit (unsigned long m_code, enum insn_class class)
   unsigned long pb_high = 0;
   unsigned long pb_low = 0;
 
-  if (class == INSN_CLASS_32)
+  if (i_class == INSN_CLASS_32)
     {
       pb_high = 0x80000000;
       pb_low = 0x00008000;
     }
-  else if (class == INSN_CLASS_16)
+  else if (i_class == INSN_CLASS_16)
     {
       pb_high = 0;
       pb_low = 0;
     }
-  else if (class == INSN_CLASS_PCE)
+  else if (i_class == INSN_CLASS_PCE)
     {
       pb_high = 0;
       pb_low = 0x00008000;
     }
-  else if (class == INSN_CLASS_SYN)
+  else if (i_class == INSN_CLASS_SYN)
     {
       /* FIXME.  at this time, INSN_CLASS_SYN must be 32 bit, but, instruction type should
          be changed if macro instruction has been expanded.  */
@@ -2804,7 +2804,7 @@ s7_parse_16_32_inst (char *insnstr, bfd_boolean gen_frag_p)
       s7_inst.size = s7_GET_INSN_SIZE (s7_inst.type);
       s7_inst.relax_size = 0;
       s7_inst.bwarn = 0;
-      sprintf (s7_inst.name, "%s", opcode->template);
+      sprintf (s7_inst.name, "%s", opcode->template_name);
       strcpy (s7_inst.reg, "");
       s7_inst.error = NULL;
       s7_inst.reloc.type = BFD_RELOC_NONE;
@@ -3306,7 +3306,6 @@ s7_do_ldst_insn (char *str)
 
           if (s7_inst.reloc.exp.X_op == O_constant)
             {
-              int value;
               unsigned int data_type;
 
               if (pre_inc == 1)
@@ -4789,7 +4788,8 @@ s7_do_macro_ldst_label (char *str)
         {
           int ldst_idx = 0;
           ldst_idx = s7_inst.instruction & OPC_PSEUDOLDST_MASK;
-          s7_build_lwst_pic (reg_rd, s7_inst.reloc.exp, s7_score_ldst_insns[ldst_idx * 3 + 0].template);
+          s7_build_lwst_pic (reg_rd, s7_inst.reloc.exp,
+                             s7_score_ldst_insns[ldst_idx * 3 + 0].template_name);
           return;
         }
       else
@@ -5092,20 +5092,22 @@ s7_build_score_ops_hsh (void)
   for (i = 0; i < sizeof (s7_score_insns) / sizeof (struct s7_asm_opcode); i++)
     {
       const struct s7_asm_opcode *insn = s7_score_insns + i;
-      unsigned len = strlen (insn->template);
-      struct s7_asm_opcode *new;
-      char *template;
-      new = obstack_alloc (&insn_obstack, sizeof (struct s7_asm_opcode));
-      template = obstack_alloc (&insn_obstack, len + 1);
-
-      strcpy (template, insn->template);
-      new->template = template;
-      new->parms = insn->parms;
-      new->value = insn->value;
-      new->relax_value = insn->relax_value;
-      new->type = insn->type;
-      new->bitmask = insn->bitmask;
-      hash_insert (s7_score_ops_hsh, new->template, (void *) new);
+      unsigned len = strlen (insn->template_name);
+      struct s7_asm_opcode *new_opcode;
+      char *template_name;
+      new_opcode = (struct s7_asm_opcode *)
+          obstack_alloc (&insn_obstack, sizeof (struct s7_asm_opcode));
+      template_name = (char *) obstack_alloc (&insn_obstack, len + 1);
+
+      strcpy (template_name, insn->template_name);
+      new_opcode->template_name = template_name;
+      new_opcode->parms = insn->parms;
+      new_opcode->value = insn->value;
+      new_opcode->relax_value = insn->relax_value;
+      new_opcode->type = insn->type;
+      new_opcode->bitmask = insn->bitmask;
+      hash_insert (s7_score_ops_hsh, new_opcode->template_name,
+                   (void *) new_opcode);
     }
 }
 
@@ -5120,14 +5122,18 @@ s7_build_dependency_insn_hsh (void)
     {
       const struct s7_insn_to_dependency *tmp = s7_insn_to_dependency_table + i;
       unsigned len = strlen (tmp->insn_name);
-      struct s7_insn_to_dependency *new;
+      struct s7_insn_to_dependency *new_i2d;
 
-      new = obstack_alloc (&dependency_obstack, sizeof (struct s7_insn_to_dependency));
-      new->insn_name = obstack_alloc (&dependency_obstack, len + 1);
+      new_i2d = (struct s7_insn_to_dependency *)
+          obstack_alloc (&dependency_obstack,
+                         sizeof (struct s7_insn_to_dependency));
+      new_i2d->insn_name = (char *) obstack_alloc (&dependency_obstack,
+                                                   len + 1);
 
-      strcpy (new->insn_name, tmp->insn_name);
-      new->type = tmp->type;
-      hash_insert (s7_dependency_insn_hsh, new->insn_name, (void *) new);
+      strcpy (new_i2d->insn_name, tmp->insn_name);
+      new_i2d->type = tmp->type;
+      hash_insert (s7_dependency_insn_hsh, new_i2d->insn_name,
+                   (void *) new_i2d);
     }
 }
 
@@ -5238,8 +5244,8 @@ s7_b32_relax_to_b16 (fragS * fragp)
 {
   int grows = 0;
   int relaxable_p = 0;
-  int old;
-  int new;
+  int r_old;
+  int r_new;
   int frag_addr = fragp->fr_address + fragp->insn_addr;
 
   addressT symbol_address = 0;
@@ -5253,8 +5259,8 @@ s7_b32_relax_to_b16 (fragS * fragp)
      so in relax stage , it may be wrong to calculate the symbol's offset when the frag's section
      is different from the symbol's.  */
 
-  old = s7_RELAX_OLD (fragp->fr_subtype);
-  new = s7_RELAX_NEW (fragp->fr_subtype);
+  r_old = s7_RELAX_OLD (fragp->fr_subtype);
+  r_new = s7_RELAX_NEW (fragp->fr_subtype);
   relaxable_p = s7_RELAX_OPT (fragp->fr_subtype);
 
   s = fragp->fr_symbol;
@@ -6187,11 +6193,11 @@ s7_assemble (char *str)
    instruction in the error message.  */
 
 static void
-s7_operand (expressionS * expr)
+s7_operand (expressionS * exp)
 {
   if (s7_in_my_get_expression)
     {
-      expr->X_op = O_illegal;
+      exp->X_op = O_illegal;
       if (s7_inst.error == NULL)
         {
           s7_inst.error = _("bad expression");
@@ -6274,7 +6280,7 @@ s7_atof (int type, char *litP, int *sizeP)
    Called after md_convert_frag().  */
 
 static void
-s7_frag_check (fragS * fragp)
+s7_frag_check (fragS * fragp ATTRIBUTE_UNUSED)
 {
   know (fragp->insn_addr <= s7_RELAX_PAD_BYTE);
 }
@@ -6575,28 +6581,28 @@ s7_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
                 segT sec ATTRIBUTE_UNUSED,
                 fragS * fragp)
 {
-  int old;
-  int new;
+  int r_old;
+  int r_new;
   char backup[20];
   fixS *fixp;
 
-  old = s7_RELAX_OLD (fragp->fr_subtype);
-  new = s7_RELAX_NEW (fragp->fr_subtype);
+  r_old = s7_RELAX_OLD (fragp->fr_subtype);
+  r_new = s7_RELAX_NEW (fragp->fr_subtype);
 
   /* fragp->fr_opcode indicates whether this frag should be relaxed.  */
   if (fragp->fr_opcode == NULL)
     {
-      memcpy (backup, fragp->fr_literal, old);
-      fragp->fr_fix = old;
+      memcpy (backup, fragp->fr_literal, r_old);
+      fragp->fr_fix = r_old;
     }
   else
     {
-      memcpy (backup, fragp->fr_literal + old, new);
-      fragp->fr_fix = new;
+      memcpy (backup, fragp->fr_literal + r_old, r_new);
+      fragp->fr_fix = r_new;
     }
 
   fixp = fragp->tc_frag_data.fixp;
-  while (fixp && fixp->fx_frag == fragp && fixp->fx_where < old)
+  while (fixp && fixp->fx_frag == fragp && fixp->fx_where < r_old)
     {
       if (fragp->fr_opcode)
        fixp->fx_done = 1;
@@ -6605,7 +6611,7 @@ s7_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
   while (fixp && fixp->fx_frag == fragp)
     {
       if (fragp->fr_opcode)
-       fixp->fx_where -= old + fragp->insn_addr;
+       fixp->fx_where -= r_old + fragp->insn_addr;
       else
        fixp->fx_done = 1;
       fixp = fixp->fx_next;
This page took 0.02636 seconds and 4 git commands to generate.