OSDN Git Service

* c-typeck.c (common_type): Correct comment.
[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 vdef_optype_d GTY(())
43 {
44   unsigned num_vdefs; 
45   tree GTY((length ("%h.num_vdefs * 2"))) vdefs[1];
46 } vdef_optype_t;
47
48 typedef vdef_optype_t *vdef_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 #define USE_OPS(ANN)            get_use_ops (ANN)
59 #define STMT_USE_OPS(STMT)      get_use_ops (stmt_ann (STMT))
60 #define NUM_USES(OPS)           ((OPS) ? (OPS)->num_uses : 0)
61 #define USE_OP_PTR(OPS, I)      get_use_op_ptr ((OPS), (I))
62 #define USE_OP(OPS, I)          (*(USE_OP_PTR ((OPS), (I))))
63
64
65 #define DEF_OPS(ANN)            get_def_ops (ANN)
66 #define STMT_DEF_OPS(STMT)      get_def_ops (stmt_ann (STMT))
67 #define NUM_DEFS(OPS)           ((OPS) ? (OPS)->num_defs : 0)
68 #define DEF_OP_PTR(OPS, I)      get_def_op_ptr ((OPS), (I))
69 #define DEF_OP(OPS, I)          (*(DEF_OP_PTR ((OPS), (I))))
70
71
72 #define VDEF_OPS(ANN)           get_vdef_ops (ANN)
73 #define STMT_VDEF_OPS(STMT)     get_vdef_ops (stmt_ann(STMT))
74 #define NUM_VDEFS(OPS)          ((OPS) ? (OPS)->num_vdefs : 0)
75 #define VDEF_RESULT_PTR(OPS, I) get_vdef_result_ptr ((OPS), (I))
76 #define VDEF_RESULT(OPS, I)     (*(VDEF_RESULT_PTR ((OPS), (I))))
77 #define VDEF_OP_PTR(OPS, I)     get_vdef_op_ptr ((OPS), (I))
78 #define VDEF_OP(OPS, I)         (*(VDEF_OP_PTR ((OPS), (I))))
79
80
81 #define VUSE_OPS(ANN)           get_vuse_ops (ANN)
82 #define STMT_VUSE_OPS(STMT)     get_vuse_ops (stmt_ann(STMT))
83 #define NUM_VUSES(OPS)          ((OPS) ? (OPS)->num_vuses : 0)
84 #define VUSE_OP_PTR(OPS, I)     get_vuse_op_ptr ((OPS), (I))
85 #define VUSE_OP(OPS, I)         (*(VUSE_OP_PTR ((OPS), (I))))
86
87
88 extern void init_ssa_operands (void);
89 extern void fini_ssa_operands (void);
90 extern void verify_start_operands (tree);
91 extern void finalize_ssa_stmt_operands (tree);
92 void add_vuse (tree, tree);
93 extern void get_stmt_operands (tree);
94 extern void remove_vuses (tree);
95 extern void remove_vdefs (tree);
96
97 #endif  /* GCC_TREE_SSA_OPERANDS_H  */