# HG changeset patch # User kent # Date 1252656900 -32400 # Node ID be566c4d18c5f191a562c13ec34da67e4a75a37d # Parent ab98828ce7a706f2bae97e21412ba47512c969b9 refactor diff -r ab98828ce7a7 -r be566c4d18c5 gcc/c-parser.c --- a/gcc/c-parser.c Fri Sep 11 14:52:24 2009 +0900 +++ b/gcc/c-parser.c Fri Sep 11 17:15:00 2009 +0900 @@ -5851,42 +5851,22 @@ struct c_arg_info *args; struct c_declspecs *specs; struct c_typespec t; - - { /* nested function's parameters (int _retval,void *fp) */ - struct c_declspecs *_retval_specs, - *_envp_specs; - struct c_declarator*_retval_decl, - *_envp_decl; - struct c_parm *_retval, - *_envp; - tree _retval_ident, - _envp_ident; - struct c_typespec t; - + { + tree _retval_decl, _envp_decl; push_scope (); declare_parm_level (); - _retval_specs = build_null_declspecs(); - t.kind = ctsk_resword; - //t.spec = integer_type_node; - t.spec = get_identifier("int"); - declspecs_add_type (_retval_specs, t); - finish_declspecs (_retval_specs); - _retval_decl = build_id_declarator (get_identifier ("_retval")); - _retval = build_c_parm (_retval_specs, NULL_TREE, _retval_decl); - - push_parm_decl(_retval); - - _envp_specs = build_null_declspecs(); - t.kind = ctsk_resword; - t.spec = get_identifier("void"); - declspecs_add_type (_envp_specs, t); - finish_declspecs (_envp_specs); - _envp_decl = build_id_declarator (get_identifier ("_envp")); - _envp_decl = make_pointer_declarator (build_null_declspecs (), _envp_decl); - _envp = build_c_parm (_envp_specs, NULL_TREE, _envp_decl); - - push_parm_decl(_envp); + _retval_decl = build_decl (PARM_DECL, get_identifier ("_retval"), integer_type_node); + DECL_SOURCE_LOCATION (_retval_decl) = loc; + DECL_ARG_TYPE (_retval_decl) = integer_type_node; + pushdecl (_retval_decl); + finish_decl (_retval_decl, NULL_TREE, NULL_TREE); + + _envp_decl = build_decl (PARM_DECL, get_identifier ("_envp"), ptr_type_node); + DECL_SOURCE_LOCATION (_envp_decl) = loc; + DECL_ARG_TYPE (_envp_decl) = ptr_type_node; + pushdecl (_envp_decl); + finish_decl (_envp_decl, NULL_TREE, NULL_TREE); args = get_parm_info(false); pop_scope(); @@ -5934,6 +5914,7 @@ add_stmt (build_stmt (DECL_EXPR, decl)); return decl; + } /* Parse a postfix expression after a parenthesized type name: the