- /* Exchange the types */
- old_type->type_op = type_id;
- old_type->mode = (ir_mode *) new_type;
+ /* @@@@
+ Things to deal with:
+ * After exchange_types the type has two entries in the list of
+ all types in irp. So far this is fine for the walker.
+ Maybe it's better to remove the id entry and shrink the list.
+ Does this conflict with the walker? Might a type be left out
+ during the walk?
+ * Deallocation: if the Id is removed from the list it will eventually
+ disappear in a memory leak. When is impossible to determine so we
+ need to hold it in a separate list for deallocation.
+ */
+
+ /* Exchange the types */
+ old_type->type_op = type_id;
+ old_type->mode = (ir_mode *) new_type;
+ /* ensure that the frame, value param, global and tls flags
+ are set right if these types are exchanged */
+ new_type->flags |= flags;