OSDN Git Service

* doc/tree-ssa.texi: Remove references to VDEF and add descriptions
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-operands.h
1 /* SSA operand management for trees.
2    Copyright (C) 2003 Free Software Foundation, Inc.
3
4 This file is part of GCC.
5
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
9 version.
10
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING.  If not, write to the Free
18 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19 02111-1307, USA.  */
20
21 #ifndef GCC_TREE_SSA_OPERANDS_H
22 #define GCC_TREE_SSA_OPERANDS_H
23
24 /* Interface to SSA operands.  */
25
26 typedef struct def_optype_d GTY(())
27 {
28   unsigned num_defs; 
29   tree * GTY((length("%h.num_defs"), skip(""))) defs[1];
30 } def_optype_t;
31
32 typedef def_optype_t *def_optype;
33
34 typedef struct use_optype_d GTY(())
35 {
36   unsigned num_uses; 
37   tree * GTY((length("%h.num_uses"), skip(""))) uses[1];
38 } use_optype_t;
39
40 typedef use_optype_t *use_optype;
41
42 typedef struct v_may_def_optype_d GTY(())
43 {
44   unsigned num_v_may_defs; 
45   tree GTY((length ("%h.num_v_may_defs * 2"))) v_may_defs[1];
46 } v_may_def_optype_t;
47
48 typedef v_may_def_optype_t *v_may_def_optype;
49
50 typedef struct vuse_optype_d GTY(()) 
51 {
52   unsigned num_vuses; 
53   tree GTY((length ("%h.num_vuses"))) vuses[1];
54 } vuse_optype_t;
55
56 typedef vuse_optype_t *vuse_optype;
57
58 typedef struct v_must_def_optype_d GTY(())
59 {
60   unsigned num_v_must_defs; 
61   tree GTY((length("%h.num_v_must_defs"))) v_must_defs[1];
62 } v_must_def_optype_t;
63
64 typedef v_must_def_optype_t *v_must_def_optype;
65
66 #define USE_OPS(ANN)            get_use_ops (ANN)
67 #define STMT_USE_OPS(STMT)      get_use_ops (stmt_ann (STMT))
68 #define NUM_USES(OPS)           ((OPS) ? (OPS)->num_uses : 0)
69 #define USE_OP_PTR(OPS, I)      get_use_op_ptr ((OPS), (I))
70 #define USE_OP(OPS, I)          (*(USE_OP_PTR ((OPS), (I))))
71
72
73 #define DEF_OPS(ANN)            get_def_ops (ANN)
74 #define STMT_DEF_OPS(STMT)      get_def_ops (stmt_ann (STMT))
75 #define NUM_DEFS(OPS)           ((OPS) ? (OPS)->num_defs : 0)
76 #define DEF_OP_PTR(OPS, I)      get_def_op_ptr ((OPS), (I))
77 #define DEF_OP(OPS, I)          (*(DEF_OP_PTR ((OPS), (I))))
78
79
80 #define V_MAY_DEF_OPS(ANN)              get_v_may_def_ops (ANN)
81 #define STMT_V_MAY_DEF_OPS(STMT)        get_v_may_def_ops (stmt_ann(STMT))
82 #define NUM_V_MAY_DEFS(OPS)             ((OPS) ? (OPS)->num_v_may_defs : 0)
83 #define V_MAY_DEF_RESULT_PTR(OPS, I)    get_v_may_def_result_ptr ((OPS), (I))
84 #define V_MAY_DEF_RESULT(OPS, I)        (*(V_MAY_DEF_RESULT_PTR ((OPS), (I))))
85 #define V_MAY_DEF_OP_PTR(OPS, I)        get_v_may_def_op_ptr ((OPS), (I))
86 #define V_MAY_DEF_OP(OPS, I)            (*(V_MAY_DEF_OP_PTR ((OPS), (I))))
87
88
89 #define VUSE_OPS(ANN)           get_vuse_ops (ANN)
90 #define STMT_VUSE_OPS(STMT)     get_vuse_ops (stmt_ann(STMT))
91 #define NUM_VUSES(OPS)          ((OPS) ? (OPS)->num_vuses : 0)
92 #define VUSE_OP_PTR(OPS, I)     get_vuse_op_ptr ((OPS), (I))
93 #define VUSE_OP(OPS, I)         (*(VUSE_OP_PTR ((OPS), (I))))
94
95
96 #define V_MUST_DEF_OPS(ANN)             get_v_must_def_ops (ANN)
97 #define STMT_V_MUST_DEF_OPS(STMT)       get_v_must_def_ops (stmt_ann (STMT))
98 #define NUM_V_MUST_DEFS(OPS)            ((OPS) ? (OPS)->num_v_must_defs : 0)
99 #define V_MUST_DEF_OP_PTR(OPS, I)       get_v_must_def_op_ptr ((OPS), (I))
100 #define V_MUST_DEF_OP(OPS, I)           (*(V_MUST_DEF_OP_PTR ((OPS), (I))))
101
102 extern void init_ssa_operands (void);
103 extern void fini_ssa_operands (void);
104 extern void verify_start_operands (tree);
105 extern void finalize_ssa_stmt_operands (tree);
106 void add_vuse (tree, tree);
107 extern void get_stmt_operands (tree);
108 extern void remove_vuses (tree);
109 extern void remove_v_may_defs (tree);
110 extern void remove_v_must_defs (tree);
111
112 #endif  /* GCC_TREE_SSA_OPERANDS_H  */