90ee3d04552c1175cfe7641f7090c8c0ae1aebe7
[libfirm] / ir / ana / irlivechk.h
1 /**
2  * @file   irlivechk.h
3  * @date   22.04.2007
4  * @author Sebastian Hack
5  *
6  * Live in/end checks whose only precomputation concerns the structure of the CFG.
7  * Hence, nothing has to be updated if the program is modified unless the CFG is touched.
8  * See .c file for more comments.
9  *
10  * Copyright (C) 2007 Universitaet Karlsruhe
11  * Released under the GPL
12  */
13
14 #ifndef _IRLIVECHK_H
15 #define _IRLIVECHK_H
16
17 #include "irgraph.h"
18 #include "irnode.h"
19
20 typedef struct _lv_chk_t lv_chk_t;
21
22 /**
23  * Make a new liveness check environment.
24  * @param irg The graph.
25  * @return    The environment.
26  */
27 extern lv_chk_t *lv_chk_new(ir_graph *irg);
28
29 /**
30  * Free liveness check information.
31  * @param lv The liveness check information.
32  */
33 extern void lv_chk_free(lv_chk_t *lv);
34
35 /**
36  * Check, if a node is live end of a given block.
37  * @param lv   The liveness environment.
38  * @param bl   The block to investigate.
39  * @param irn  The node to check for.
40  * @return     1, if @p what is live end at @p bl, 0 else.
41  */
42 extern int lv_chk_bl_end(const lv_chk_t *lv, const ir_node *bl, const ir_node *irn);
43
44 /**
45  * Check, if a node is live out of a given block.
46  * @param lv   The liveness environment.
47  * @param bl   The block to investigate.
48  * @param irn  The node to check for.
49  * @return     1, if @p what is live out at @p bl, 0 else.
50  */
51 extern int lv_chk_bl_out(const lv_chk_t *lv, const ir_node *bl, const ir_node *irn);
52
53 /**
54  * Check, if a node is live in of a given block.
55  * @param lv   The liveness environment.
56  * @param bl   The block to investigate.
57  * @param irn  The node to check for.
58  * @return     1, if @p what is live in at @p bl, 0 else.
59  */
60 extern int lv_chk_bl_in(const lv_chk_t *lv, const ir_node *bl, const ir_node *irn);
61
62 #endif /* _IRLIVECHK_H */