diff options
author | Dan Nicolaescu <dann@ics.uci.edu> | 2003-08-27 00:49:19 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2003-08-27 00:49:19 +0000 |
commit | 522df488848b3a3989032f895118e49a242c82d5 (patch) | |
tree | 5a0b3f9f8c514eb41ab9de7c968c15aa3bd2051a /gcc/cp/parser.c | |
parent | 82ba99d59e56c2d0774c267624583341a96b681f (diff) | |
download | gcc-522df488848b3a3989032f895118e49a242c82d5.zip gcc-522df488848b3a3989032f895118e49a242c82d5.tar.gz gcc-522df488848b3a3989032f895118e49a242c82d5.tar.bz2 |
parser.c (struct cp_token): Use enum bitfields.
2003-08-26 Dan Nicolaescu <dann@ics.uci.edu>
* parser.c (struct cp_token): Use enum bitfields.
(CP_TOKEN_BLOCK_NUM_TOKENS): Make sure cp_token_block fits in a
512B allocation unit.
(cp_parser_token_tree_map_node): Use enum bitfields.
From-SVN: r70837
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 1fb1a51..735d592 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -68,19 +68,20 @@ typedef struct cp_token GTY (()) { /* The kind of token. */ - enum cpp_ttype type; - /* The value associated with this token, if any. */ - tree value; + enum cpp_ttype type : 8; /* If this token is a keyword, this value indicates which keyword. Otherwise, this value is RID_MAX. */ - enum rid keyword; + enum rid keyword : 8; + /* The value associated with this token, if any. */ + tree value; /* The location at which this token was found. */ location_t location; } cp_token; -/* The number of tokens in a single token block. */ +/* The number of tokens in a single token block. + Computed so that cp_token_block fits in a 512B allocation unit. */ -#define CP_TOKEN_BLOCK_NUM_TOKENS 32 +#define CP_TOKEN_BLOCK_NUM_TOKENS ((512 - 3*sizeof (char*))/sizeof (cp_token)) /* A group of tokens. These groups are chained together to store large numbers of tokens. (For example, a token block is created @@ -1062,9 +1063,9 @@ typedef enum cp_parser_declarator_kind typedef struct cp_parser_token_tree_map_node { /* The token type. */ - enum cpp_ttype token_type; + enum cpp_ttype token_type : 8; /* The corresponding tree code. */ - enum tree_code tree_type; + enum tree_code tree_type : 8; } cp_parser_token_tree_map_node; /* A complete map consists of several ordinary entries, followed by a |