tree is a pointer to union tree_node. tree_node is a union of various structures that have the first field of struct tree_common. (tree and tree_node are often used interchangeably).

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;

tree is a tagged structure, tree_common::code as a tag value to tell the actual type of tree. See tree_common for more detail about the common part.

A more compact representation of tree (and GIMPLE) has been proposed: tuples

See the -fdump-tree-* options argument (e.g. -fdump-tree-all -fdump-tree-original etc...) to gcc or cc1 program. From your passes, your might call the print_gimple_expr or print_gimple_stmt or print_tree functions.

None: tree (last edited 2008-01-10 19:38:45 by localhost)