1 /* Copyright (C) 2001 by Universitaet Karlsruhe
4 * Authors: Goetz Lindenmaier
10 # include "typegmod_t.h"
15 INLINE void exchange_types(type *old_type, type *new_type) {
16 /* Deallocate datastructures not directly contained in the
17 old type. We must do this now as it is the latest point
18 where we know the original kind of type.
20 free_type_attrs(old_type);
24 * After exchange_types the type has two entries in the list of
25 all types in irp. So far this is fine for the walker.
26 Maybe it's better to remove the id entry and shrink the list.
27 Does this conflict with the walker? Might a type be left out
29 * Deallocation: if the Id is removed from the list it will eventualle
30 disappear in a memory leak. When is impossible to determine so we
31 need to hold it in a seperate list for deallocation.
34 /* Exchange the types */
35 old_type->type_op = type_id;
36 old_type->mode = (ir_mode *) new_type;
39 INLINE type *skip_tid(type *tp) {
40 while (tp->type_op == type_id)
41 tp = (type *) tp->mode;