gcc源代码分析,语法树

expand_expr code = 3d
 <call_expr 840f0
    type <integer_type 824d0 int permanent SI
        size <integer_cst 8254c literal permanent 4
        align 32 size_unit 8 sep_unit 32 symtab 0
        sep <integer_cst 8251c literal permanent -2147483648 precision 32 min <integer_cst 8251c -2147483648>
        max <integer_cst 82534 literal permanent 2147483647
        pointer_to_this <pointer_type 88b4c> chain <integer_type 825bc char>
    volatile
    arg 0 <addr_expr 84090
        type <pointer_type 98f48 type <function_type 956e8>
            permanent unsigned SI size <integer_cst 8254c 4>
            align 32 size_unit 8 sep_unit 32 symtab 0
       
        arg 0 <function_decl 95740 printf type <function_type 956e8>
            external public permanent used QI file /usr/include/stdio.h line 214
            align 1 size_unit 1 offset 0 chain <function_decl 954d8 ungetc>
    arg 1 <tree_list 83270
        value <nop_expr 840d8 type <pointer_type 9117c>
            literal
            arg 0 <nop_expr 840c0 type <pointer_type 88a44>
                literal
                arg 0 <addr_expr 840a8 type <pointer_type 94f58>
                    literal
                    arg 0 <string_cst 84014 type <array_type 94ef4>
                        static literal "Hello, world!

"(nil)



printf在stdio.h里面有函数声明,并且在函数rest_of_decl_compilation()里面生成了rtx

rest_of_decl_compilation
 <function_decl 95740 printf
    type <function_type 956e8
        type <integer_type 824d0 int permanent SI
            size <integer_cst 8254c literal permanent 4
            align 32 size_unit 8 sep_unit 32 symtab 0
            sep <integer_cst 8251c literal permanent -2147483648 precision 32 min <integer_cst 8251c -2147483648>
            max <integer_cst 82534 literal permanent 2147483647
            pointer_to_this <pointer_type 88b4c> chain <integer_type 825bc char>
        permanent EP
        size <integer_cst 82dd8 literal permanent 8
        align 32 size_unit 8 sep_unit 0 symtab 0
        arg-types <tree_list 95698 permanent value <pointer_type 9117c>
    external public permanent QI file /usr/include/stdio.h line 214
    align 1 size_unit 1 offset 0 chain <function_decl 954d8 ungetc>

(symbol_ref:SI ("printf"))

(mem:QI (symbol_ref:SI ("printf")))


gcc源代码分析,语法树

上一篇:关于如何用WORD实现图片转文字


下一篇:Ubuntu 进入单用户模式—修改启动项利器