irio: Added support for DivRL
[libfirm] / ir / tr / typewalk.c
index 6369474..1c0b0d6 100644 (file)
  * - execute the pre function before recursion
  * - execute the post function after recursion
  */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
+#include "config.h"
 
+#include <stdlib.h>
 #include <stdio.h>
 
 #include "entity_t.h"
@@ -233,8 +228,6 @@ static void do_type_walk(type_or_ent tore,
        /* execute post method */
        if (post)
                post(tore, env);
-
-       return;
 }
 
 /**  Check whether node contains types or entities as an attribute.
@@ -283,6 +276,23 @@ void type_walk(type_walk_func *pre, type_walk_func *post, void *env) {
        do_type_walk(cont, pre, post, env);
 }
 
+void type_walk_plus_frames(type_walk_func *pre, type_walk_func *post, void *env) {
+       int i, n_irgs = get_irp_n_irgs();
+       type_or_ent cont;
+
+       type_walk(pre, post, env);
+
+       for (i = 0; i < n_irgs; ++i) {
+               ir_graph *irg = get_irp_irg(i);
+               cont.typ = get_irg_frame_type(irg);
+               do_type_walk(cont, pre, post, env);
+
+               cont.typ = get_method_value_param_type(get_entity_type(get_irg_entity(irg)));
+               if(cont.typ)
+                       do_type_walk(cont, pre, post, env);
+       }
+}
+
 void type_walk_irg(ir_graph *irg,
                    type_walk_func *pre,
                    type_walk_func *post,
@@ -319,7 +329,6 @@ void type_walk_irg(ir_graph *irg,
        do_type_walk(cont, pre, post, env);
 
        current_ir_graph = rem;
-       return;
 }
 
 static void type_walk_s2s_2(type_or_ent tore,
@@ -399,7 +408,6 @@ static void type_walk_s2s_2(type_or_ent tore,
                printf(" *** Faulty type or entity! \n");
                break;
        }
-       return;
 }
 
 void type_walk_super2sub(type_walk_func *pre,
@@ -494,7 +502,6 @@ type_walk_super_2(type_or_ent tore,
                printf(" *** Faulty type or entity! \n");
                break;
        }
-       return;
 }
 
 void type_walk_super(type_walk_func *pre,
@@ -548,8 +555,6 @@ class_walk_s2s_2(ir_type *tp,
        /* execute post method */
        if (post)
                post(tp, env);
-
-       return;
 }
 
 void class_walk_super2sub(class_walk_func *pre,