Use get_type_[un]lowered instead of get_associated_type
authorAndreas Zwinkau <zwinkau@kit.edu>
Wed, 20 Apr 2011 11:46:28 +0000 (13:46 +0200)
committerAndreas Zwinkau <zwinkau@kit.edu>
Wed, 20 Apr 2011 12:06:18 +0000 (14:06 +0200)
ir/be/bestabs.c
ir/lower/lower_calls.c
ir/tr/type_t.h

index 66babf2..73bc8a8 100644 (file)
@@ -699,8 +699,7 @@ static void stabs_method_begin(dbg_handle *handle, const ir_entity *ent)
 
        /* create the method entry */
        mtp = get_entity_type(ent);
-       assert (is_lowered_type(mtp));
-       mtp = get_associated_type(mtp);
+       mtp = get_type_unlowered(mtp);
        if (get_method_n_ress(mtp) > 0)
                rtp = get_method_res_type(mtp, 0);
        else
index 37c4de1..ced3de0 100644 (file)
@@ -86,7 +86,7 @@ static ir_type *create_modified_mtd_type(const lower_params_t *lp, ir_type *mtp)
 
        assert(!is_lowered_type(mtp) && "lowered types not yet implemented");
 
-       lowered = get_associated_type(mtp);
+       lowered = get_type_lowered(mtp);
        if (lowered != NULL)
                return lowered;
 
@@ -512,8 +512,7 @@ static void add_hidden_param(ir_graph *irg, size_t n_com, ir_node **ins, cl_entr
                size_t   i;
                size_t   j;
 
-               assert (is_lowered_type(ctp));
-               ctp = get_associated_type(ctp);
+               ctp = get_type_unlowered(ctp);
 
                for (j = i = 0; i < get_method_n_ress(ctp); ++i) {
                        ir_type *rtp = get_method_res_type(ctp, i);
index 13818ed..e06265b 100644 (file)
@@ -308,6 +308,19 @@ static inline void _set_master_type_visited(ir_visited_t val) { firm_type_visite
 static inline ir_visited_t _get_master_type_visited(void)     { return firm_type_visited; }
 static inline void _inc_master_type_visited(void)             { ++firm_type_visited; }
 
+static inline ir_type *get_type_unlowered(const ir_type *tp)
+{
+       assert (is_lowered_type(tp));
+       return tp->assoc_type;
+}
+
+static inline ir_type *get_type_lowered(const ir_type *tp)
+{
+       assert (tp->assoc_type == NULL || is_lowered_type(tp->assoc_type));
+       return tp->assoc_type;
+}
+
+
 static inline void *_get_type_link(const ir_type *tp)
 {
        assert(tp && tp->kind == k_type);