Convert c_string_type to an enum flags type

c_string_type contains values meant to be OR'ed together (even though
some bits are mutually exclusive), so it makes sense to make it an
enum flags type.

gdb/ChangeLog:
2015-11-17  Simon Marchi  <simon.marchi@ericsson.com>

	* c-exp.y (exp): Adjust, change enum c_string_type to
	c_string_type.
	(parse_string_or_char): Likewise.
	* c-lang.c (charset_for_string_type): Likewise.
	(classify_type): Likewise.
	(c_printchar): Likewise.
	(c_printstr): Likewise.
	(evaluate_subexp_c): Likewise.  And change cast to enum
	c_string_type_values.
	* c-lang.h: Include "common/enum_flags.h".
	(enum c_string_type): Rename to...
	(enum c_string_type_values): ...this.
	(c_string_type): Define new enum flags type.
This commit is contained in:
Simon Marchi
2015-11-17 13:31:29 +00:00
committed by Pedro Alves
parent 8d297bbf60
commit 0c801b9663
4 changed files with 31 additions and 13 deletions

View File

@ -29,12 +29,13 @@ struct parser_state;
#include "value.h"
#include "macroexp.h"
#include "parser-defs.h"
#include "common/enum-flags.h"
/* The various kinds of C string and character. Note that these
values are chosen so that they may be or'd together in certain
ways. */
enum c_string_type
enum c_string_type_values
{
/* An ordinary string: "value". */
C_STRING = 0,
@ -56,6 +57,8 @@ enum c_string_type
C_CHAR_32 = 7
};
DEF_ENUM_FLAGS_TYPE (enum c_string_type_values, c_string_type);
/* Defined in c-exp.y. */
extern int c_parse (struct parser_state *);