Commit 608477bd by Neil Booth

cppexp.c (lex): Use NODE_NAME and NODE_LEN.

	* cppexp.c (lex): Use NODE_NAME and NODE_LEN.
	* cpphash.c (_cpp_lookup_with_hash): Similarly.
	* cpplex.c (cpp_ideq, parse_identifier, cpp_token_len,
	cpp_spell_token, cpp_output_token): Similarly.
	* cpplib.c (lex_macro_node, do_undef, do_pragma,
	do_pragma_poison, parse_assertion, do_assert): Similarly.
	* cppmacro.c (builtin_macro, parse_args, funlike_invocation_p,
	save_parameter, _cpp_create_definition, check_trad_stringification,
	cpp_macro_definition): Similarly.
	* cppmain.c (cb_define, cb_undef, dump_macro): Similarly.
	* c-lex.c (cb_undef, c_lex): Similarly.
	* fix-header.c (recognized_function): Similarly.
	* cpplib.h (NODE_LEN, NODE_NAME): New.
	(cpp_hashnode): Rename length len.

From-SVN: r42172
parent c25d4f6a
...@@ -37,7 +37,7 @@ typedef struct cpp_buffer cpp_buffer; ...@@ -37,7 +37,7 @@ typedef struct cpp_buffer cpp_buffer;
typedef struct cpp_options cpp_options; typedef struct cpp_options cpp_options;
typedef struct cpp_token cpp_token; typedef struct cpp_token cpp_token;
typedef struct cpp_string cpp_string; typedef struct cpp_string cpp_string;
typedef struct cpp_hashnode cpp_hashnode; typedef struct c_common_identifier cpp_hashnode;
typedef struct cpp_macro cpp_macro; typedef struct cpp_macro cpp_macro;
typedef struct cpp_lexer_pos cpp_lexer_pos; typedef struct cpp_lexer_pos cpp_lexer_pos;
typedef struct cpp_lookahead cpp_lookahead; typedef struct cpp_lookahead cpp_lookahead;
...@@ -177,7 +177,7 @@ struct cpp_token ...@@ -177,7 +177,7 @@ struct cpp_token
union union
{ {
struct cpp_hashnode *node; /* An identifier. */ cpp_hashnode *node; /* An identifier. */
struct cpp_string str; /* A string, or number. */ struct cpp_string str; /* A string, or number. */
unsigned int arg_no; /* Argument no. for a CPP_MACRO_ARG. */ unsigned int arg_no; /* Argument no. for a CPP_MACRO_ARG. */
unsigned char c; /* Character represented by CPP_OTHER. */ unsigned char c; /* Character represented by CPP_OTHER. */
...@@ -466,21 +466,21 @@ enum builtin_type ...@@ -466,21 +466,21 @@ enum builtin_type
BT_STDC /* `__STDC__' */ BT_STDC /* `__STDC__' */
}; };
/* There is a slot in the hashnode for use by front ends when integrated #include "c-rid.h"
with cpplib. It holds a tree (see tree.h) but we mustn't drag that
header into every user of cpplib.h. cpplib does not do anything with
this slot except clear it when a new node is created. */
union tree_node;
struct cpp_hashnode #define C_RID_CODE(id) (((struct c_common_identifier *) (id))->rid_code)
/* The common part of an identifier node shared amongst all 3 C front
ends. Also used to store CPP identifiers, which are a superset of
identifiers in the grammatical sense. */
struct c_common_identifier
{ {
const unsigned char *name; /* Null-terminated name. */ struct tree_identifier ident; /* See tree-core.h. */
unsigned int hash; /* Cached hash value. */
unsigned short length; /* Length of name excluding null. */
unsigned short arg_index; /* Macro argument index. */ unsigned short arg_index; /* Macro argument index. */
unsigned char directive_index; /* Index into directive table. */ unsigned char directive_index; /* Index into directive table. */
ENUM_BITFIELD(node_type) type : 8; /* Node type. */ ENUM_BITFIELD(rid) rid_code : 8; /* Rid code - for front ends. */
unsigned char flags; /* Node flags. */ ENUM_BITFIELD(node_type) type : 8; /* CPP node type. */
unsigned char flags; /* CPP flags. */
union union
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment