diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-05-10 14:27:32 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-05-10 14:27:32 +0000 |
commit | 2ee04baa68b1550bd7c06cee36b87adf3176a6c6 (patch) | |
tree | c5f8e2e7ce183b106614d41e5e99dcd5c47f5581 /libcpp/directives.c | |
parent | 5eaad62c471572a312c7e3f6f08c2a25ba891c80 (diff) | |
download | gcc-2ee04baa68b1550bd7c06cee36b87adf3176a6c6.tar.gz |
gcc:
* c-lex.c (c_lex_with_flags): Expect cpp_hashnode in
tok->val.node.node.
libcpp:
* include/cpplib.h (enum cpp_token_fld_kind): Add
CPP_TOKEN_FLD_TOKEN_NO.
(struct cpp_macro_arg, struct cpp_identifier): Define.
(union cpp_token_u): Use struct cpp_identifier for identifiers.
Use struct cpp_macro_arg for macro arguments. Add token_no for
CPP_PASTE token numbers.
* directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
do_pragma_poison, parse_assertion): Use val.node.node in place of
val.node.
* expr.c (parse_defined, eval_token): Use val.node.node in place
of val.node.
* lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
place of val.arg_no. Use val.node.node in place of val.node.
* macro.c (replace_args, cpp_get_token, parse_params,
lex_expansion_token, create_iso_definition, cpp_macro_definition):
Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
Use val.node.node in place of val.node.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147341 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/directives.c')
-rw-r--r-- | libcpp/directives.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libcpp/directives.c b/libcpp/directives.c index c2e71016f24..e71efb2bd94 100644 --- a/libcpp/directives.c +++ b/libcpp/directives.c @@ -408,8 +408,8 @@ _cpp_handle_directive (cpp_reader *pfile, int indented) if (dname->type == CPP_NAME) { - if (dname->val.node->is_directive) - dir = &dtable[dname->val.node->directive_index]; + if (dname->val.node.node->is_directive) + dir = &dtable[dname->val.node.node->directive_index]; } /* We do not recognize the # followed by a number extension in assembler code. */ @@ -538,7 +538,7 @@ lex_macro_node (cpp_reader *pfile, bool is_def_or_undef) if (token->type == CPP_NAME) { - cpp_hashnode *node = token->val.node; + cpp_hashnode *node = token->val.node.node; if (is_def_or_undef && node == pfile->spec_nodes.n_defined) cpp_error (pfile, CPP_DL_ERROR, @@ -549,7 +549,7 @@ lex_macro_node (cpp_reader *pfile, bool is_def_or_undef) else if (token->flags & NAMED_OP) cpp_error (pfile, CPP_DL_ERROR, "\"%s\" cannot be used as a macro name as it is an operator in C++", - NODE_NAME (token->val.node)); + NODE_NAME (token->val.node.node)); else if (token->type == CPP_EOF) cpp_error (pfile, CPP_DL_ERROR, "no macro name given in #%s directive", pfile->directive->name); @@ -1329,7 +1329,7 @@ do_pragma (cpp_reader *pfile) ns_token = *token; if (token->type == CPP_NAME) { - p = lookup_pragma_entry (pfile->pragmas, token->val.node); + p = lookup_pragma_entry (pfile->pragmas, token->val.node.node); if (p && p->is_nspace) { bool allow_name_expansion = p->allow_expansion; @@ -1337,7 +1337,7 @@ do_pragma (cpp_reader *pfile) pfile->state.prevent_expansion--; token = cpp_get_token (pfile); if (token->type == CPP_NAME) - p = lookup_pragma_entry (p->u.space, token->val.node); + p = lookup_pragma_entry (p->u.space, token->val.node.node); else p = NULL; if (allow_name_expansion) @@ -1429,7 +1429,7 @@ do_pragma_poison (cpp_reader *pfile) break; } - hp = tok->val.node; + hp = tok->val.node.node; if (hp->flags & NODE_POISONED) continue; @@ -1986,12 +1986,12 @@ parse_assertion (cpp_reader *pfile, struct answer **answerp, int type) cpp_error (pfile, CPP_DL_ERROR, "predicate must be an identifier"); else if (parse_answer (pfile, answerp, type) == 0) { - unsigned int len = NODE_LEN (predicate->val.node); + unsigned int len = NODE_LEN (predicate->val.node.node); unsigned char *sym = (unsigned char *) alloca (len + 1); /* Prefix '#' to get it out of macro namespace. */ sym[0] = '#'; - memcpy (sym + 1, NODE_NAME (predicate->val.node), len); + memcpy (sym + 1, NODE_NAME (predicate->val.node.node), len); result = cpp_lookup (pfile, sym, len + 1); } |