Shave 4 bytes from parse_node_t

Bitfields ftw
This commit is contained in:
ridiculousfish 2015-12-19 18:09:41 -08:00
parent ad72421b2c
commit 6aa2cbe807
2 changed files with 5 additions and 3 deletions

View file

@ -1149,7 +1149,9 @@ void parse_ll_t::accept_tokens(parse_token_t token1, parse_token_t token2)
// Get the production for the top of the stack // Get the production for the top of the stack
parse_stack_element_t &stack_elem = symbol_stack.back(); parse_stack_element_t &stack_elem = symbol_stack.back();
parse_node_t &node = nodes.at(stack_elem.node_idx); parse_node_t &node = nodes.at(stack_elem.node_idx);
const production_t *production = production_for_token(stack_elem.type, token1, token2, &node.tag); parse_node_tag_t tag = 0;
const production_t *production = production_for_token(stack_elem.type, token1, token2, &tag);
node.tag = tag;
if (production == NULL) if (production == NULL)
{ {
parse_error_failed_production(stack_elem, token1); parse_error_failed_production(stack_elem, token1);

View file

@ -103,10 +103,10 @@ public:
enum parse_keyword_t keyword; enum parse_keyword_t keyword;
/* Node flags */ /* Node flags */
parse_node_flags_t flags; parse_node_flags_t flags:4;
/* This is used to store e.g. the statement decoration. */ /* This is used to store e.g. the statement decoration. */
parse_node_tag_t tag; parse_node_tag_t tag:4;
/* Description */ /* Description */
wcstring describe(void) const; wcstring describe(void) const;