c-lex.c (c_lex_with_flags): Expect cpp_hashnode in tok->val.node.node.
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. From-SVN: r147341
This commit is contained in:
parent
fb0be16980
commit
9a0c618755
8 changed files with 104 additions and 60 deletions
|
@ -651,7 +651,7 @@ parse_defined (cpp_reader *pfile)
|
|||
|
||||
if (token->type == CPP_NAME)
|
||||
{
|
||||
node = token->val.node;
|
||||
node = token->val.node.node;
|
||||
if (paren && cpp_get_token (pfile)->type != CPP_CLOSE_PAREN)
|
||||
{
|
||||
cpp_error (pfile, CPP_DL_ERROR, "missing ')' after \"defined\"");
|
||||
|
@ -771,14 +771,14 @@ eval_token (cpp_reader *pfile, const cpp_token *token)
|
|||
break;
|
||||
|
||||
case CPP_NAME:
|
||||
if (token->val.node == pfile->spec_nodes.n_defined)
|
||||
if (token->val.node.node == pfile->spec_nodes.n_defined)
|
||||
return parse_defined (pfile);
|
||||
else if (CPP_OPTION (pfile, cplusplus)
|
||||
&& (token->val.node == pfile->spec_nodes.n_true
|
||||
|| token->val.node == pfile->spec_nodes.n_false))
|
||||
&& (token->val.node.node == pfile->spec_nodes.n_true
|
||||
|| token->val.node.node == pfile->spec_nodes.n_false))
|
||||
{
|
||||
result.high = 0;
|
||||
result.low = (token->val.node == pfile->spec_nodes.n_true);
|
||||
result.low = (token->val.node.node == pfile->spec_nodes.n_true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -786,7 +786,7 @@ eval_token (cpp_reader *pfile, const cpp_token *token)
|
|||
result.low = 0;
|
||||
if (CPP_OPTION (pfile, warn_undef) && !pfile->state.skip_eval)
|
||||
cpp_error (pfile, CPP_DL_WARNING, "\"%s\" is not defined",
|
||||
NODE_NAME (token->val.node));
|
||||
NODE_NAME (token->val.node.node));
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue