remove license stuff from files
[libfirm] / include / libfirm / cdep.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5
6 /**
7  * @file
8  * @brief   control dependence analysis
9  * @author  Christoph Mallon
10  */
11 #ifndef FIRM_ANA_CDEP_H
12 #define FIRM_ANA_CDEP_H
13
14 #include "firm_types.h"
15 #include "begin.h"
16
17 /** @ingroup irana
18  * @defgroup ir_cdep Control Dependence
19  * @{
20  */
21
22 /** Computes the control dependence graph for a graph. */
23 FIRM_API void compute_cdep(ir_graph *irg);
24
25 /** Frees the control dependence info. */
26 FIRM_API void free_cdep(ir_graph *irg);
27
28 /** Returns control dependent block */
29 FIRM_API ir_node *get_cdep_node(const ir_cdep *cdep);
30
31 /** Returns next entry in a list of cdeps */
32 FIRM_API ir_cdep *get_cdep_next(const ir_cdep *cdep);
33
34 /**
35  * Returns a list of all control dependences of a block.
36  */
37 FIRM_API ir_cdep *find_cdep(const ir_node *block);
38
39 /**
40  * Replaces the control dependence info of old by the info of nw.
41  */
42 FIRM_API void exchange_cdep(ir_node *old, const ir_node *nw);
43
44 /**
45  * Checks whether dependee is (directly) control dependent on candidate.
46  *
47  * @param dependee   the (possible) dependent block
48  * @param candidate  the (possible) block on which dependee is dependent
49  */
50 FIRM_API int is_cdep_on(const ir_node *dependee, const ir_node *candidate);
51
52 /**
53  * If block is control dependent on exactly one node, returns this node,
54  * else NULL.
55  *
56  * @param block  the block to check
57  */
58 FIRM_API ir_node *get_unique_cdep(const ir_node *block);
59
60 /**
61  * Checks if the given block is control dependent of more than one node.
62  *
63  * @param block   the block to check
64  */
65 FIRM_API int has_multiple_cdep(const ir_node *block);
66
67 /** @} */
68
69 #include "end.h"
70
71 #endif