1 /* SSA operand management for trees.
2 Copyright (C) 2003 Free Software Foundation, Inc.
4 This file is part of GCC.
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
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
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
21 #ifndef GCC_TREE_SSA_OPERANDS_H
22 #define GCC_TREE_SSA_OPERANDS_H
24 /* Interface to SSA operands. */
26 typedef struct def_optype_d
GTY(())
29 tree
* GTY((length("%h.num_defs"), skip(""))) defs
[1];
32 typedef def_optype_t
*def_optype
;
34 typedef struct use_optype_d
GTY(())
37 tree
* GTY((length("%h.num_uses"), skip(""))) uses
[1];
40 typedef use_optype_t
*use_optype
;
42 typedef struct vdef_optype_d
GTY(())
45 tree
GTY((length ("%h.num_vdefs * 2"))) vdefs
[1];
48 typedef vdef_optype_t
*vdef_optype
;
50 typedef struct vuse_optype_d
GTY(())
53 tree
GTY((length ("%h.num_vuses"))) vuses
[1];
56 typedef vuse_optype_t
*vuse_optype
;
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))))
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))))
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))))
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))))
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
);
97 #endif /* GCC_TREE_SSA_OPERANDS_H */