* File name: ir/tr/typegmod.c
* Purpose: Functionality to modify the type graph.
* Author: Goetz Lindenmaier
- * Modified by:
+ * Modified by: Michael Beck
* Created:
* CVS-ID: $Id$
- * Copyright: (c) 2001-2003 Universität Karlsruhe
+ * Copyright: (c) 2001-2006 Universität Karlsruhe
* Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-# include "typegmod.h"
-# include "type_t.h"
-# include "tpop_t.h"
-# include "irmode.h"
+#include "typegmod.h"
+#include "type_t.h"
+#include "tpop_t.h"
+#include "irmode.h"
void exchange_types(ir_type *old_type, ir_type *new_type) {
+ unsigned flags = old_type->flags & (tf_frame_type | tf_value_param_type | tf_global_type | tf_tls_type);
/* Deallocate datastructures not directly contained in the
old type. We must do this now as it is the latest point
where we know the original kind of type.
/* 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;
}
ir_type *skip_tid(ir_type *tp) {