码迷,mamicode.com
首页 > 其他好文 > 详细

gcc源代码分析,finish_decl ()函数和push_parm_decl ()函数分析

时间:2015-01-14 22:55:48      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:gcc   源代码   分析   

parms:
    parm
        { push_parm_decl ($1); }

/* This is what appears inside the parens in a function declarator.
   Is value is represented in the format that grokdeclarator expects.  */
parmlist_2:  /* empty */
        { $$ = get_parm_info (0); }
    | parms
        { $$ = get_parm_info (1); }
    | parms ‘,‘ ELLIPSIS
        { $$ = get_parm_info (0); }


ELLIPSIS 表示...

/* Given a parsed parameter declaration,

   decode it into a PARM_DECL and push that on the current binding level.  */

void
push_parm_decl (parm)
     tree parm;
{
  register tree decl = grokdeclarator (TREE_VALUE (parm), TREE_PURPOSE (parm),
                       PARM, 0);

  /* Add this decl to the current binding level.  */
  finish_decl (pushdecl (decl), NULL_TREE, NULL_TREE);
}

<tree_list 95680表示push_parm_decl ()函数的参数。

 <parm_decl 941c0表示grokdeclarator ()函数的返回结果。


in push_parm_decl
 <tree_list 95680 permanent
    purpose <tree_list 95650 permanent
        value <identifier_node 82038 char permanent global <type_decl 82650 char>
        chain <tree_list 95638 permanent
            value <identifier_node 82210 const permanent chain <tree_list 95638>
    value <indirect_ref 95668 permanent
in build_pointer_type
 <integer_type 91130 char readonly permanent QI
    size <integer_cst 82638 type <integer_type 82848* unsigned int> literal permanent 1
    align 8 size_unit 8 sep_unit 8 symtab 0
    sep <integer_cst 82608 type <integer_type 825bc* char> literal permanent -128 precision 8 min <integer_cst 82608 -128>
    max <integer_cst 82620 type <integer_type 825bc* char> literal permanent 127
    pointer_to_this <pointer_type 9117c>
 <parm_decl 941c0
    type <pointer_type 9117c
        type <integer_type 91130 char readonly permanent QI
            size <integer_cst 82638 literal permanent 1
            align 8 size_unit 8 sep_unit 8 symtab 0
            sep <integer_cst 82608 literal permanent -128 precision 8 min <integer_cst 82608 -128>
            max <integer_cst 82620 literal permanent 127
            pointer_to_this <pointer_type 9117c>
        permanent unsigned SI
        size <integer_cst 8254c literal permanent 4
        align 32 size_unit 8 sep_unit 32 symtab 0
        chain <function_type 912c0>
    unsigned SI file /usr/include/stdio.h line 214 size <integer_cst 8254c 4>
    align 32 size_unit 8 offset 0 arguments <pointer_type 9117c>
in finish_decl
 <parm_decl 941c0
    type <pointer_type 9117c
        type <integer_type 91130 char readonly permanent QI
            size <integer_cst 82638 literal permanent 1
            align 8 size_unit 8 sep_unit 8 symtab 0
            sep <integer_cst 82608 literal permanent -128 precision 8 min <integer_cst 82608 -128>
            max <integer_cst 82620 literal permanent 127
            pointer_to_this <pointer_type 9117c>
        permanent unsigned SI
        size <integer_cst 8254c literal permanent 4
        align 32 size_unit 8 sep_unit 32 symtab 0
        chain <function_type 912c0>
    unsigned SI file /usr/include/stdio.h line 214 size <integer_cst 8254c 4>
    align 32 size_unit 8 offset 0 arguments <pointer_type 9117c>


gcc源代码分析,finish_decl ()函数和push_parm_decl ()函数分析

标签:gcc   源代码   分析   

原文地址:http://blog.csdn.net/oldlinux/article/details/42716355

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!