libFirm 1.20
libfirm/irdom.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
00003  *
00004  * This file is part of libFirm.
00005  *
00006  * This file may be distributed and/or modified under the terms of the
00007  * GNU General Public License version 2 as published by the Free Software
00008  * Foundation and appearing in the file LICENSE.GPL included in the
00009  * packaging of this file.
00010  *
00011  * Licensees holding valid libFirm Professional Edition licenses may use
00012  * this file in accordance with the libFirm Commercial License.
00013  * Agreement provided with the Software.
00014  *
00015  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00016  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00017  * PURPOSE.
00018  */
00019 
00027 #ifndef FIRM_ANA_IRDOM_H
00028 #define FIRM_ANA_IRDOM_H
00029 
00030 #include "firm_types.h"
00031 #include "begin.h"
00032 
00051 FIRM_API ir_node *get_Block_idom(const ir_node *block);
00052 
00054 FIRM_API ir_node *get_Block_ipostdom(const ir_node *block);
00055 
00064 FIRM_API int block_dominates(const ir_node *a, const ir_node *b);
00065 
00074 FIRM_API int block_strictly_dominates(const ir_node *a, const ir_node *b);
00075 
00084 FIRM_API int block_postdominates(const ir_node *a, const ir_node *b);
00085 
00094 FIRM_API int block_strictly_postdominates(const ir_node *a, const ir_node *b);
00095 
00107 FIRM_API ir_node *get_Block_dominated_first(const ir_node *block);
00111 FIRM_API ir_node *get_Block_postdominated_first(const ir_node *bl);
00112 
00120 FIRM_API ir_node *get_Block_dominated_next(const ir_node *node);
00124 FIRM_API ir_node *get_Block_postdominated_next(const ir_node *node);
00125 
00132 #define dominates_for_each(bl,curr) \
00133     for(curr = get_Block_dominated_first(bl); curr; \
00134             curr = get_Block_dominated_next(curr))
00135 
00142 #define postdominates_for_each(bl,curr) \
00143     for(curr = get_Block_postdominated_first(bl); curr; \
00144             curr = get_Block_postdominated_next(curr))
00145 
00152 FIRM_API ir_node *node_smallest_common_dominator(ir_node *a, ir_node *b);
00153 
00163 FIRM_API void dom_tree_walk(ir_node *n, irg_walk_func *pre,
00164                             irg_walk_func *post, void *env);
00165 
00175 FIRM_API void postdom_tree_walk(ir_node *n, irg_walk_func *pre,
00176                                 irg_walk_func *post, void *env);
00177 
00185 FIRM_API void dom_tree_walk_irg(ir_graph *irg, irg_walk_func *pre,
00186                                 irg_walk_func *post, void *env);
00187 
00195 FIRM_API void postdom_tree_walk_irg(ir_graph *irg, irg_walk_func *pre,
00196                                     irg_walk_func *post, void *env);
00197 
00213 FIRM_API void compute_doms(ir_graph *irg);
00214 
00216 FIRM_API void assure_doms(ir_graph *irg);
00217 
00233 FIRM_API void compute_postdoms(ir_graph *irg);
00234 
00236 FIRM_API void assure_postdoms(ir_graph *irg);
00237 
00239 FIRM_API void free_dom(ir_graph *irg);
00240 
00244 FIRM_API void free_postdom(ir_graph *irg);
00245 
00248 #include "end.h"
00249 
00250 #endif