Commit 0c206cf6 authored by Michael Beck's avatar Michael Beck
Browse files

add doxygen comments

[r16559]
parent 99b96354
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
/** /**
* @file * @file
* @brief control dependence analysis * @brief control dependence analysis
* @author Chrsitoph Mallon * @author Christoph Mallon
* @version $Id$ * @version $Id$
*/ */
#ifndef FIRM_ANA_CDEP_H #ifndef FIRM_ANA_CDEP_H
...@@ -28,25 +28,56 @@ ...@@ -28,25 +28,56 @@
#include "firm_types.h" #include "firm_types.h"
/**
* An entry in the control dependence list.
*/
typedef struct cdep cdep; typedef struct cdep cdep;
struct cdep { struct cdep {
ir_node *node; ir_node *node; /**< A node on which the current block is control dependent on. */
cdep *next; cdep *next; /**< Link to the next one if any. */
}; };
/** Compute the control dependence graph for a graph. */ /** Compute the control dependence graph for a graph. */
void compute_cdep(ir_graph *irg); void compute_cdep(ir_graph *irg);
/** Free the control dependence info. */
void free_cdep(ir_graph *irg); void free_cdep(ir_graph *irg);
/**
* Return a list of all control dependences of a block.
*/
cdep *find_cdep(const ir_node *block); cdep *find_cdep(const ir_node *block);
void exchange_cdep(ir_node *old, const ir_node *nw); 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); 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); 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); 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); int has_multiple_cdep(const ir_node *block);
#endif #endif
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
#include "xmalloc.h" #include "xmalloc.h"
#include "cdep.h" #include "cdep.h"
#include "irprintf.h" #include "irprintf.h"
#include "irdump.h"
static pmap *cdep_map; static pmap *cdep_map;
...@@ -114,8 +116,6 @@ static void cdep_pre(ir_node *node, void *ctx) ...@@ -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. * A block edge hook: add all cdep edges of block.
*/ */
...@@ -156,7 +156,10 @@ void compute_cdep(ir_graph *irg) ...@@ -156,7 +156,10 @@ void compute_cdep(ir_graph *irg)
assure_postdoms(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); start_block = get_irg_start_block(irg);
rem = get_Block_ipostdom(start_block); rem = get_Block_ipostdom(start_block);
set_Block_ipostdom(start_block, get_irg_end_block(irg)); set_Block_ipostdom(start_block, get_irg_end_block(irg));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment