Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 编程语言 > C/C++ > gcc研究笔记(一)tree是什么
【标  题】:gcc研究笔记(一)tree是什么
【关键字】:gcc,tree
【来  源】:http://blog.csdn.net/Goncely/archive/2006/11/14/1384565.aspx

gcc研究笔记(一)tree是什么

Your Ad Here          在gcc中,几乎所有的东西都是用树结构串起来的,从而形成所谓的general tree。tree可以看作是指向树节点的指针,所有的树节点都有一个共同的基类:tree_common。
在文件coretypes.h中,tree的定义如下:
#ifndef USED_FOR_TARGET
...
typedef union tree_node *tree;
...
#else
...
#define tree union _dont_use_tree_here_ *
...
#endif
可见,当USED_FOR_TARGET宏未被定义的时候,tree是指向联合类型tree_node的指针类型;否则,tree是一个定义为union _dont_use_tree_here_ *的宏。
在tree.h中,可以找到union tree_node的定义:
union tree_node
{
 struct tree_common common;
 struct tree_int_cst int_cst;
 struct tree_real_cst real_cst;
 struct tree_vector vector;
 struct tree_string string;
 struct tree_complex complex;
 struct tree_identifier identifier;
 struct tree_decl_minimal decl_minimal;
 struct tree_decl_common decl_common;
 struct tree_decl_with_rtl decl_with_rtl;
 struct tree_decl_non_common decl_non_common;
 struct tree_parm_decl parm_decl;
 struct tree_decl_with_vis decl_with_vis;
 struct tree_var_decl var_decl;
 struct tree_field_decl field_decl;
 struct tree_label_decl label_decl;
 struct tree_result_decl result_decl;
 struct tree_const_decl const_decl;
 struct tree_type_decl type_decl;
 struct tree_function_decl function_decl;
 struct tree_type type;
 struct tree_list list;
 struct tree_vec vec;
 struct tree_exp exp;
 struct tree_ssa_name ssa_name;
 struct tree_phi_node phi;
 struct tree_block block;
 struct tree_binfo binfo;
 struct tree_statement_list stmt_list;
 struct tree_value_handle value_handle;
 struct tree_constructor constructor;
 struct tree_memory_tag mtag;
 struct tree_struct_field_tag sft;
 struct tree_omp_clause omp_clause;
};
 
同样,tree_common的定义也在tree.h中:
struct tree_common
{
 tree chain;
 tree type;
 union tree_ann_d *ann;
 ENUM_BITFIELD(tree_code) code : 8;
 unsigned side_effects_flag : 1;
 unsigned constant_flag : 1;
 unsigned addressable_flag : 1;
 unsigned volatile_flag : 1;
 unsigned readonly_flag : 1;
 unsigned unsigned_flag : 1;
 unsigned asm_written_flag: 1;
 unsigned nowarning_flag : 1;
 unsigned used_flag : 1;
 unsigned nothrow_flag : 1;
 unsigned static_flag : 1;
 unsigned public_flag : 1;
 unsigned private_flag : 1;
 unsigned protected_flag : 1;
 unsigned deprecated_flag : 1;
 unsigned invariant_flag : 1;
 unsigned lang_flag_0 : 1;
 unsigned lang_flag_1 : 1;
 unsigned lang_flag_2 : 1;
 unsigned lang_flag_3 : 1;
 unsigned lang_flag_4 : 1;
 unsigned lang_flag_5 : 1;
 unsigned lang_flag_6 : 1;
 unsigned visited : 1;
};
 
BHO (Browser Helper Object 浏览器辅助对象) 原理:【上一篇】
转: C++动态内存创建与内存管理学习笔记[3]:【下一篇】
【相关文章】
  • gcc研究笔记(二)cp和cpplib的接口
  • gcc使用中碰到的
  • 把DamnSmallLinux(DSL)安装到硬盘(虚拟机)并安装GCC
  • linus早期在新闻组上的Posts(03) 发贴答复关于gcc 1.40 for Minix-386的问题
  • GCC编译时请加入-lm
  • linus早期在新闻组上的Posts(02)第一次发贴询问Gcc-1.40 and a posix-question的情况
  • DTree is so so great!!
  • dhAjaxTreeView2.0发布
  • 自定义控件-TreeGrid
  • Locks tree sessions
  • 【随机文章】
  • 映射端口_内网服务器显示ROS_内网IP的解决
  • 流着口水出去^_^
  • Flash表单制作实例集锦(六)
  • 偶像剧《王子变青蛙》分集介绍
  • gmail的收件人是搜索并全文通配的
  • 致 java 爱好者(3)
  • ▲▽▲手机上网、WAP常识及免费wap网站网址小卡片▲▽▲
  • 转换ASP到ASP+
  • 生成一个批处理文件,指令GHOST备份/还原..
  • 阻燃超5类4对屏蔽双绞线(305米/箱)
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.