From: Michael Beck Date: Fri, 16 Nov 2007 15:38:01 +0000 (+0000) Subject: add doxygen comments X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=0c206cf66ead39ebfc0e2fc3f310e8a26af4a82a;p=libfirm add doxygen comments [r16559] --- diff --git a/include/libfirm/cdep.h b/include/libfirm/cdep.h index 102efc451..88bf8023e 100644 --- a/include/libfirm/cdep.h +++ b/include/libfirm/cdep.h @@ -20,7 +20,7 @@ /** * @file * @brief control dependence analysis - * @author Chrsitoph Mallon + * @author Christoph Mallon * @version $Id$ */ #ifndef FIRM_ANA_CDEP_H @@ -28,25 +28,56 @@ #include "firm_types.h" +/** + * An entry in the control dependence list. + */ typedef struct cdep cdep; struct cdep { - ir_node *node; - cdep *next; + ir_node *node; /**< A node on which the current block is control dependent on. */ + cdep *next; /**< Link to the next one if any. */ }; /** Compute the control dependence graph for a graph. */ void compute_cdep(ir_graph *irg); + +/** Free the control dependence info. */ void free_cdep(ir_graph *irg); +/** + * Return a list of all control dependences of a block. + */ cdep *find_cdep(const ir_node *block); void exchange_cdep(ir_node *old, const ir_node *nw); +/** + * Check whether dependee is (directly) control dependent on candidate. + * + * @param dependee the (possible) dependent block + * @param candidate the (possible) block on which dependee is dependent + */ int is_cdep_on(const ir_node *dependee, const ir_node *candidate); +/** + * Check whether dependee is (possible iterated) control dependent on candidate. + * + * @param dependee the (possible) dependent block + * @param candidate the (possible) block on which dependee is dependent + */ int is_iterated_cdep_on(ir_node *dependee, ir_node *candidate); +/** + * If block is control dependent on exactly one node, return this node, else NULL. + * + * @param block the block to check + */ ir_node *get_unique_cdep(const ir_node *block); + +/** + * check if the given block is control dependent of more than one node. + * + * @param block the block to check + */ int has_multiple_cdep(const ir_node *block); #endif diff --git a/ir/ana/cdep.c b/ir/ana/cdep.c index d746f19da..4070ca0a4 100644 --- a/ir/ana/cdep.c +++ b/ir/ana/cdep.c @@ -32,6 +32,8 @@ #include "xmalloc.h" #include "cdep.h" #include "irprintf.h" +#include "irdump.h" + static pmap *cdep_map; @@ -114,8 +116,6 @@ static void cdep_pre(ir_node *node, void *ctx) } -#include "irdump.h" - /** * A block edge hook: add all cdep edges of block. */ @@ -156,7 +156,10 @@ void compute_cdep(ir_graph *irg) assure_postdoms(irg); - /* we must temporary change the post dominator relation */ + /* we must temporary change the post dominator relation: + the ipdom of the startblock is the end block. + Firm does NOT add the phantom edge from Start to End. + */ start_block = get_irg_start_block(irg); rem = get_Block_ipostdom(start_block); set_Block_ipostdom(start_block, get_irg_end_block(irg));