gas/arc: Make member of arc_flags const

By making the flgp field of struct arc_flags constant we can remove a
place where we cast away the const-ness of a variable.  Also, given that
the value assigned to this field almost always comes from compile-time
constant data, having the field non-constant is probably a bad thing.

gas/ChangeLog:

	* config/tc-arc.c (find_opcode_match): Remove casting away of
	const.
	* config/tc-arc.h (struct arc_flags): Make flgp field const.
This commit is contained in:
Andrew Burgess 2016-05-06 13:59:03 +01:00
parent 9e32d9ae97
commit 38cd8a0de8
3 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2016-05-18 Andrew Burgess <andrew.burgess@embecosm.com>
* config/tc-arc.c (find_opcode_match): Remove casting away of
const.
* config/tc-arc.h (struct arc_flags): Make flgp field const.
2016-05-18 Andrew Burgess <andrew.burgess@embecosm.com>
* config/tc-arc.c (md_pcrel_from_section): Use BFD_VMA_FMT where

View File

@ -1883,7 +1883,7 @@ find_opcode_match (const struct arc_opcode_hash_entry *entry,
if (pflag->flgp != NULL)
goto match_failed;
cl_matches++;
pflag->flgp = (struct arc_flag_operand *) flg_operand;
pflag->flgp = flg_operand;
lnflg--;
break; /* goto next flag class and parsed flag. */
}

View File

@ -225,7 +225,7 @@ struct arc_flags
char name[MAX_FLAG_NAME_LENGTH + 1];
/* Pointer to arc flags. */
struct arc_flag_operand *flgp;
const struct arc_flag_operand *flgp;
};
extern const relax_typeS md_relax_table[];