- activated WITH_UNKNOWN
[libfirm] / ir / ana / irextbb.c
index 500af68..78963d9 100644 (file)
@@ -24,9 +24,7 @@
  * @date     5.2005
  * @version  $Id$
  */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
 
 #include "irextbb_t.h"
 #include "irgwalk.h"
@@ -37,6 +35,9 @@
 #include "xmalloc.h"
 #include "irprintf.h"
 
+/**
+ * Environment for extbb construction.
+ */
 typedef struct _env {
        struct obstack *obst;   /**< the obstack where allocations took place */
        ir_extblk *head;        /**< head of the list of all extended blocks */
@@ -111,7 +112,7 @@ static void pre_walk_calc_extbb(ir_node *block, void *ctx) {
                         */
                        ir_node *cf_op = skip_Proj(get_Block_cfgpred(block, 0));
 
-                       if (!irn_visited(cf_op)) {
+                       if (!irn_visited_else_mark(cf_op)) {
                                ir_node *pred_bl = get_nodes_block(cf_op);
                                if (get_block_n_succs(pred_bl) > 2) {
                                        /* More than two successors means we have a jump table.
@@ -125,7 +126,6 @@ static void pre_walk_calc_extbb(ir_node *block, void *ctx) {
                                         */
                                        set_Block_extbb(block, NULL);
                                }
-                               mark_irn_visited(cf_op);
                        } else {
                                /* already marked, so begin a new extended block here */
                                allocate_extblk(block, env);