removed dependency of irnode.h
[libfirm] / ir / common / survive_dce.h
1 /**
2  * A facility for nodes to "survive" the dead code elimination.
3  */
4
5 #ifndef _FIRM_SURVIVE_DCE_H
6 #define _FIRM_SURVIVE_DCE_H
7
8 #include "pmap.h"
9
10 typedef struct _survive_dce_t survive_dce_t;
11
12 /**
13  * Make a new dead code survive instance.
14  */
15 survive_dce_t *new_survive_dce(void);
16
17 /**
18  * Free a dead node survive instance.
19  */
20 void           free_survive_dce(survive_dce_t *sd);
21
22 /**
23  * Register a storage place for a node.
24  * @param sd The survive dead code private data.
25  * @param place A pointer to a node pointer which shall be actualized.
26  * The location given by <code>place</code> will be updated with the substitute
27  * of the node it is currently pointing to after dead node elimination.
28  */
29 void survive_dce_register_irn(survive_dce_t *sd, ir_node **place);
30
31 /**
32  * Register a map to survive the dce.
33  * All value parts of the map's entries are assumed to be ir node pointers
34  * and are registered with survive_dce_register_irn().
35  * @param sd    The survive dce private data.
36  * @param m     The map.
37  */
38 void survive_dce_register_pmap(survive_dce_t *sd, pmap *m);
39
40 #endif