OSDN Git Service

* tree.def (VTABLE_REF): Remove.
[pf3gnuchains/gcc-fork.git] / gcc / tree-gimple.h
1 /* Functions to analyze and validate GIMPLE trees.
2    Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3    Contributed by Diego Novillo <dnovillo@redhat.com>
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22 #ifndef _TREE_SIMPLE_H
23 #define _TREE_SIMPLE_H 1
24
25
26 #include "tree-iterator.h"
27
28 extern tree create_tmp_var_raw (tree, const char *);
29 extern tree create_tmp_var_name (const char *);
30 extern tree create_tmp_var (tree, const char *);
31 extern bool is_gimple_tmp_var (tree);
32 extern tree get_initialized_tmp_var (tree, tree *, tree *);
33 extern tree get_formal_tmp_var (tree, tree *);
34 extern void declare_tmp_vars (tree, tree);
35
36 extern tree rationalize_compound_expr (tree);
37 extern tree right_assocify_expr (tree);
38 extern void annotate_all_with_locus (tree *, location_t);
39
40 /* Validation of GIMPLE expressions.  Note that these predicates only check
41    the basic form of the expression, they don't recurse to make sure that
42    underlying nodes are also of the right form.  */
43
44 /* Returns true iff T is a valid GIMPLE statement.  */
45 extern bool is_gimple_stmt (tree);
46
47 /* Returns true iff TYPE is a valid type for a scalar register variable.  */
48 extern bool is_gimple_reg_type (tree);
49 /* Returns true iff T is a scalar register variable.  */
50 extern bool is_gimple_reg (tree);
51 /* Returns true iff T is any sort of variable.  */
52 extern bool is_gimple_variable (tree);
53 /* Returns true iff T is a variable or an INDIRECT_REF (of a variable).  */
54 extern bool is_gimple_min_lval (tree);
55 /* Returns true iff T is an lvalue other than an INDIRECT_REF.  */
56 extern bool is_gimple_addr_expr_arg (tree);
57 /* Returns true iff T is any valid GIMPLE lvalue.  */
58 extern bool is_gimple_lvalue (tree);
59
60 /* Returns true iff T is a GIMPLE restricted function invariant.  */
61 extern bool is_gimple_min_invariant (tree);
62 /* Returns true iff T is a GIMPLE rvalue.  */
63 extern bool is_gimple_val (tree);
64 /* Returns true iff T is a valid rhs for a MODIFY_EXPR.  */
65 extern bool is_gimple_rhs (tree);
66
67 /* Returns true iff T is a valid if-statement condition.  */
68 extern bool is_gimple_condexpr (tree);
69
70 /* Returns true iff T is a type conversion.  */
71 extern bool is_gimple_cast (tree);
72 /* Returns true iff T is a valid CONSTRUCTOR element (either an rvalue or
73    another CONSTRUCTOR).  */
74 extern bool is_gimple_constructor_elt (tree);
75 /* Returns true iff T is a variable that does not need to live in memory.  */
76 extern bool is_gimple_non_addressable (tree t);
77
78 /* Returns true iff T is a valid call address expression.  */
79 bool is_gimple_call_addr (tree);
80 /* If T makes a function call, returns the CALL_EXPR operand.  */
81 extern tree get_call_expr_in (tree t);
82
83 extern void recalculate_side_effects (tree);
84
85 extern void append_to_compound_expr (tree, tree *);
86
87 /* FIXME we should deduce this from the predicate.  */
88 typedef enum fallback_t {
89   fb_none = 0,
90   fb_rvalue = 1,
91   fb_lvalue = 2,
92   fb_mayfail = 4,
93   fb_either= fb_rvalue | fb_lvalue
94 } fallback_t;
95
96 enum gimplify_status {
97   GS_ERROR      = -2,   /* Something Bad Seen.  */
98   GS_UNHANDLED  = -1,   /* A langhook result for "I dunno".  */
99   GS_OK         = 0,    /* We did something, maybe more to do.  */
100   GS_ALL_DONE   = 1     /* The expression is fully gimplified.  */
101 };
102
103 extern enum gimplify_status gimplify_expr (tree *, tree *, tree *,
104                                            bool (*) (tree), fallback_t);
105 extern tree gimplify_type_sizes (tree);
106 extern void gimplify_one_sizepos (tree *, tree *);
107 extern void gimplify_stmt (tree *);
108 extern void gimplify_to_stmt_list (tree *);
109 extern void gimplify_body (tree *, tree);
110 extern void push_gimplify_context (void);
111 extern void pop_gimplify_context (tree);
112 extern void gimplify_and_add (tree, tree *);
113
114 /* Miscellaneous helpers.  */
115 extern tree get_base_address (tree t);
116 extern void gimple_add_tmp_var (tree);
117 extern tree gimple_current_bind_expr (void);
118 extern void gimple_push_bind_expr (tree);
119 extern void gimple_pop_bind_expr (void);
120 extern void unshare_all_trees (tree);
121 extern tree voidify_wrapper_expr (tree, tree);
122 extern tree gimple_build_eh_filter (tree, tree, tree);
123 extern tree build_and_jump (tree *);
124 extern tree alloc_stmt_list (void);
125 extern void free_stmt_list (tree);
126 extern tree force_labels_r (tree *, int *, void *);
127 extern enum gimplify_status gimplify_va_arg_expr (tree *, tree *, tree *);
128
129 /* In tree-nested.c.  */
130 extern void lower_nested_functions (tree);
131
132 #endif /* _TREE_SIMPLE_H  */