remove Cast node
[libfirm] / ir / tr / typewalk.c
index 1c32934..2f07ca9 100644 (file)
@@ -41,6 +41,7 @@
 #include "irnode_t.h"
 #include "irgwalk.h"
 #include "error.h"
+#include "ircons.h"
 
 /**
  * The walker environment
@@ -92,7 +93,6 @@ static void do_type_walk(type_or_ent tore,
        size_t      i, n_types, n_mem;
        ir_entity   *ent = NULL;
        ir_type     *tp = NULL;
-       ir_node     *n;
        type_or_ent cont;
 
        /* marked? */
@@ -128,12 +128,6 @@ static void do_type_walk(type_or_ent tore,
                /* walk over the value types */
                if (ent->initializer != NULL) {
                        walk_initializer(ent->initializer, pre, post, env);
-               } else if (entity_has_compound_ent_values(ent)) {
-                       size_t i, n_mem = get_compound_ent_n_values(ent);
-                       for (i = 0; i < n_mem; ++i) {
-                               n = get_compound_ent_value(ent, i);
-                               irn_type_walker(n, pre, post, env);
-                       }
                }
                break;
        case k_type:
@@ -256,7 +250,6 @@ static void start_type_walk(ir_node *node, void *ctx)
        irn_type_walker(node, pre, post, envi);
 }
 
-/* walker: walks over all types */
 void type_walk(type_walk_func *pre, type_walk_func *post, void *env)
 {
        size_t      i, n_types = get_irp_n_types();
@@ -273,26 +266,6 @@ void type_walk(type_walk_func *pre, type_walk_func *post, void *env)
        irp_free_resources(irp, IRP_RESOURCE_TYPE_VISITED);
 }
 
-void type_walk_prog(type_walk_func *pre, type_walk_func *post, void *env)
-{
-       size_t 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);
-       }
-
-       for (i = IR_SEGMENT_FIRST; i <= IR_SEGMENT_LAST; ++i) {
-               cont.typ = get_segment_type((ir_segment_t) i);
-               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,
@@ -521,7 +494,6 @@ static void class_walk_s2s_2(ir_type *tp, class_walk_func *pre,
        /* marked? */
        if (type_visited(tp)) return;
 
-       assert(is_Class_type(tp));
        /* Assure all supertypes are visited before */
        n = get_class_n_supertypes(tp);
        for (i = 0; i < n; ++i) {
@@ -557,9 +529,9 @@ void class_walk_super2sub(class_walk_func *pre,
                tp = get_irp_type(i);
                if (is_Class_type(tp) &&
                    (get_class_n_supertypes(tp) == 0) &&
-                   type_not_visited(tp)) {
-                       assert(! is_frame_type(tp));
-                       assert(tp != get_glob_type());
+                   type_not_visited(tp) &&
+                   (! is_frame_type(tp)) &&
+                   (tp != get_glob_type())) {
                        class_walk_s2s_2(tp, pre, post, env);
                }
        }
@@ -567,7 +539,6 @@ void class_walk_super2sub(class_walk_func *pre,
 }
 
 
-/* Walks over all entities in the type */
 void walk_types_entities(ir_type *tp,
                          entity_walk_func *doit,
                          void *env)