cleanup: Remove duplicate MIN/MAX macros.
[libfirm] / ir / ana / irdom_t.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5
6 /**
7  * @file
8  * @brief    Construct and access dominator tree -- private datastructures.
9  * @author   Goetz Lindenmaier
10  * @date     2.2002
11  */
12 #ifndef FIRM_ANA_IRDOM_T_H
13 #define FIRM_ANA_IRDOM_T_H
14
15 #include "irdom.h"
16 #include "pmap.h"
17 #include "obst.h"
18
19 /** For dominator information */
20 typedef struct ir_dom_info {
21   ir_node *idom;   /**< immediate CFG dominator */
22   ir_node *next;   /**< The next node in the dominated list of @c idom. */
23   ir_node *first;  /**< The first node in the list of nodes
24                         this nodes dominates immediately. */
25   unsigned tree_pre_num;         /**< The pre-order number from a dfs walk
26                                       over the dominator tree. */
27   unsigned max_subtree_pre_num;  /**< The largest tree pre num found in the
28                                       dominator subtree of this node. */
29   int pre_num;     /**< pre-order graph-walk number */
30   int dom_depth;   /**< depth in dominator-tree */
31 } ir_dom_info;
32
33 typedef struct ir_dom_front_info_t {
34         pmap *df_map;         /**< A map, mapping every block to a list of its dominance frontier blocks. */
35         struct obstack obst;  /**< An obstack holding all the frontier data. */
36 } ir_dom_front_info_t;
37
38 void set_Block_idom(ir_node *bl, ir_node *n);
39
40 int get_Block_dom_depth(const ir_node *bl);
41 void set_Block_dom_depth(ir_node *bl, int depth);
42
43 int get_Block_dom_pre_num(const ir_node *bl);
44 void set_Block_dom_pre_num(ir_node *bl, int num);
45
46 void set_Block_ipostdom(ir_node *bl, ir_node *n);
47
48 int get_Block_postdom_depth(const ir_node *bl);
49 void set_Block_postdom_depth(ir_node *bl, int depth);
50
51 int get_Block_postdom_pre_num(const ir_node *bl);
52 void set_Block_postdom_pre_num(ir_node *bl, int num);
53
54 unsigned get_Block_dom_tree_pre_num(const ir_node *bl);
55 unsigned get_Block_pdom_tree_pre_num(const ir_node *bl);
56
57 unsigned get_Block_dom_max_subtree_pre_num(const ir_node *bl);
58 unsigned get_Block_pdom_max_subtree_pre_num(const ir_node *bl);
59
60 void ir_free_dominance_frontiers(ir_graph *irg);
61
62 #endif