2 * Copyright (C) 1995-2007 Inria Rhone-Alpes. All right reserved.
4 * This file is part of libFirm.
6 * This file may be distributed and/or modified under the terms of the
7 * GNU General Public License version 2 as published by the Free Software
8 * Foundation and appearing in the file LICENSE.GPL included in the
9 * packaging of this file.
11 * Licensees holding valid libFirm Professional Edition licenses may use
12 * this file in accordance with the libFirm Commercial License.
13 * Agreement provided with the Software.
15 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * @author Sebastian Hack
27 * Live in/end checks whose only precomputation concerns the structure of the CFG.
28 * Hence, nothing has to be updated if the program is modified unless the CFG is touched.
29 * See .c file for more comments.
32 #ifndef FIRM_ANA_IRLIVECHK_H
33 #define FIRM_ANA_IRLIVECHK_H
43 lv_chk_state_through = lv_chk_state_in | lv_chk_state_out | lv_chk_state_end,
46 typedef struct lv_chk_t lv_chk_t;
49 * Make a new liveness check environment.
50 * @param irg The graph.
51 * @param dfs A forward DFS on CFG of the given irg.
52 * @return The environment.
54 extern lv_chk_t *lv_chk_new(ir_graph *irg, const dfs_t *dfs);
57 * Free liveness check information.
58 * @param lv The liveness check information.
60 extern void lv_chk_free(lv_chk_t *lv);
64 * Return liveness information for a node concerning a block.
65 * @param lv The liveness environment.
66 * @param bl The block to investigate.
67 * @param irn The node to check for.
68 * @return A bitmask of <code>lv_chk_state_t</code>.
70 extern unsigned lv_chk_bl_xxx(const lv_chk_t *lv, const ir_node *bl, const ir_node *irn);
72 #define lv_chk_bl_in(lv, bl, irn) ((lv_chk_bl_xxx((lv), (bl), (irn)) & lv_chk_state_in) != 0)
73 #define lv_chk_bl_end(lv, bl, irn) ((lv_chk_bl_xxx((lv), (bl), (irn)) & lv_chk_state_end) != 0)
74 #define lv_chk_bl_out(lv, bl, irn) ((lv_chk_bl_xxx((lv), (bl), (irn)) & lv_chk_state_out) != 0)
76 #endif /* FIRM_ANA_IRLIVECHK_H */