Some access routines for visited flags in entity.h, irnode.h,
[libfirm] / ir / tr / typewalk.c
index ee71534..0b95917 100644 (file)
@@ -22,6 +22,7 @@
 #include "irnode.h"
 #include "irprog.h"
 #include "type_or_entity.h"
+#include "typegmod.h"
 
 /* Make types visible to allow most efficient access */
 #include "entity_t.h"
@@ -110,6 +111,8 @@ void type_walk_2(type_or_ent *tore,
       case tpo_array:
        type_walk_2((type_or_ent *)get_array_element_type(tp),
                    pre, post, env);
+       type_walk_2((type_or_ent *)get_array_element_entity(tp),
+                   pre, post, env);
        break;
       case tpo_enumeration:
        /* a leave */
@@ -162,7 +165,6 @@ void start_type_walk(ir_node *node, void *env) {
     type_walk_2((type_or_ent *)get_Alloc_type(node), pre, post, envi);
     break;
   case iro_Free:
-    printf("here in typewalk\n");
     type_walk_2((type_or_ent *)get_Free_type(node), pre, post, envi);
     break;
   default:
@@ -175,7 +177,8 @@ void type_walk(void (pre)(type_or_ent*, void*),
               void *env) {
   int i;
   ++type_visited;
-  type_walk_2((type_or_ent *)get_glob_type(), pre, post, env);
+  /*type_walk_2((type_or_ent *)get_glob_type(), pre, post, env);
+   global type is on the list visited below, too. */
   for (i = 0; i < get_irp_n_types(); i++) {
     type_walk_2((type_or_ent *)get_irp_type(i), pre, post, env);
   }