add doxygen comments
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Fri, 16 Nov 2007 15:38:01 +0000 (15:38 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Fri, 16 Nov 2007 15:38:01 +0000 (15:38 +0000)
[r16559]

include/libfirm/cdep.h
ir/ana/cdep.c

index 102efc4..88bf802 100644 (file)
@@ -20,7 +20,7 @@
 /**
  * @file
  * @brief   control dependence analysis
- * @author  Chrsitoph Mallon
+ * @author  Christoph Mallon
  * @version $Id$
  */
 #ifndef FIRM_ANA_CDEP_H
 
 #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
index d746f19..4070ca0 100644 (file)
@@ -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));