44ecd183f49c53fe5294aa54ac772ec21d129065
[libfirm] / ir / ana / irlivechk.h
1 /*
2  * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
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.
10  *
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.
14  *
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
17  * PURPOSE.
18  */
19
20 /**
21  * @file    irlivechk.h
22  * @author  Sebastian Hack
23  * @date    22.04.2007
24  * @version $Id: $
25  * @summary
26  *
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.
30  *
31  * Copyright (C) 2007 Universitaet Karlsruhe
32  * Released under the GPL
33  */
34 #ifndef FIRM_ANA_IRLIVECHK_H
35 #define FIRM_ANA_IRLIVECHK_H
36
37 #include "irgraph.h"
38 #include "irnode.h"
39
40 typedef struct _lv_chk_t lv_chk_t;
41
42 /**
43  * Make a new liveness check environment.
44  * @param irg The graph.
45  * @return    The environment.
46  */
47 extern lv_chk_t *lv_chk_new(ir_graph *irg);
48
49 /**
50  * Free liveness check information.
51  * @param lv The liveness check information.
52  */
53 extern void lv_chk_free(lv_chk_t *lv);
54
55 /**
56  * Check, if a node is live end of a given block.
57  * @param lv   The liveness environment.
58  * @param bl   The block to investigate.
59  * @param irn  The node to check for.
60  * @return     1, if @p what is live end at @p bl, 0 else.
61  */
62 extern int lv_chk_bl_end(const lv_chk_t *lv, const ir_node *bl, const ir_node *irn);
63
64 /**
65  * Check, if a node is live out of a given block.
66  * @param lv   The liveness environment.
67  * @param bl   The block to investigate.
68  * @param irn  The node to check for.
69  * @return     1, if @p what is live out at @p bl, 0 else.
70  */
71 extern int lv_chk_bl_out(const lv_chk_t *lv, const ir_node *bl, const ir_node *irn);
72
73 /**
74  * Check, if a node is live in of a given block.
75  * @param lv   The liveness environment.
76  * @param bl   The block to investigate.
77  * @param irn  The node to check for.
78  * @return     1, if @p what is live in at @p bl, 0 else.
79  */
80 extern int lv_chk_bl_in(const lv_chk_t *lv, const ir_node *bl, const ir_node *irn);
81
82 #endif /* FIRM_ANA_IRLIVECHK_H */