X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=ir%2Fana%2Firdom_t.h;h=517cd40493dc93128f4cc6d4edb8590f420a4ffd;hb=532ca14c1686c1b14cf923371c079055670de7e6;hp=fa8a0f1af1160d0770b0a33bbe160833b0f4e6ef;hpb=de3ad6fcd245b88094f28f89284f2d62d4d50d3c;p=libfirm diff --git a/ir/ana/irdom_t.h b/ir/ana/irdom_t.h index fa8a0f1af..517cd4049 100644 --- a/ir/ana/irdom_t.h +++ b/ir/ana/irdom_t.h @@ -1,23 +1,76 @@ -/* Copyright (C) 2002 by Universitaet Karlsruhe -* All rights reserved. -* -* Authors: Goetz Lindenmaier -* -* irdom_t.h: private datastructures -*/ +/* + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * + * This file is part of libFirm. + * + * This file may be distributed and/or modified under the terms of the + * GNU General Public License version 2 as published by the Free Software + * Foundation and appearing in the file LICENSE.GPL included in the + * packaging of this file. + * + * Licensees holding valid libFirm Professional Edition licenses may use + * this file in accordance with the libFirm Commercial License. + * Agreement provided with the Software. + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. + */ -/* $Id$ */ - -# ifndef _IRDOM_T_H_ -# define _IRDOM_T_H_ +/** + * @file + * @brief Construct and access dominator tree -- private datastructures. + * @author Goetz Lindenmaier + * @date 2.2002 + */ +#ifndef FIRM_ANA_IRDOM_T_H +#define FIRM_ANA_IRDOM_T_H #include "irdom.h" +#include "pmap.h" +#include "obst.h" + +/** For dominator information */ +typedef struct ir_dom_info { + ir_node *idom; /**< immediate CFG dominator */ + ir_node *next; /**< The next node in the dominated list of @c idom. */ + ir_node *first; /**< The first node in the list of nodes + this nodes dominates immediately. */ + unsigned tree_pre_num; /**< The pre-order number from a dfs walk + over the dominator tree. */ + unsigned max_subtree_pre_num; /**< The largest tree pre num found in the + dominator subtree of this node. */ + int pre_num; /**< pre-order graph-walk number */ + int dom_depth; /**< depth in dominator-tree */ +} ir_dom_info; + +typedef struct ir_dom_front_info_t { + pmap *df_map; /**< A map, mapping every block to a list of its dominance frontier blocks. */ + struct obstack obst; /**< An obstack holding all the frontier data. */ +} ir_dom_front_info_t; + +void set_Block_idom(ir_node *bl, ir_node *n); + +int get_Block_dom_depth(const ir_node *bl); +void set_Block_dom_depth(ir_node *bl, int depth); + +int get_Block_dom_pre_num(const ir_node *bl); +void set_Block_dom_pre_num(ir_node *bl, int num); + +void set_Block_ipostdom(ir_node *bl, ir_node *n); + +int get_Block_postdom_depth(const ir_node *bl); +void set_Block_postdom_depth(ir_node *bl, int depth); + +int get_Block_postdom_pre_num(const ir_node *bl); +void set_Block_postdom_pre_num(ir_node *bl, int num); + +unsigned get_Block_dom_tree_pre_num(const ir_node *bl); +unsigned get_Block_pdom_tree_pre_num(const ir_node *bl); + +unsigned get_Block_dom_max_subtree_pre_num(const ir_node *bl); +unsigned get_Block_pdom_max_subtree_pre_num(const ir_node *bl); -/* For dominator information */ -typedef struct dom_info { - struct ir_node *idom; /* immediate CFG dominator */ - int pre_num; /* pre-order graph-walk number */ - int dom_depth; /* depth in dominator-tree */ -} dom_info; +void ir_free_dominance_frontiers(ir_graph *irg); -#endif /* _IRDOM_T_H_ */ +#endif