From 595f9b42cc7417a9a717fc15fbed2b4a969f95fe Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Mon, 11 Sep 2006 12:14:25 +0000 Subject: [PATCH] Add flags for the global and TLS type to help debugging [r8210] --- ir/tr/type.c | 2 +- ir/tr/type.h | 8 ++++---- ir/tr/type_t.h | 12 +++++++----- ir/tr/typegmod.c | 16 ++++++++++------ 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/ir/tr/type.c b/ir/tr/type.c index 268829190..cb61ac8a5 100644 --- a/ir/tr/type.c +++ b/ir/tr/type.c @@ -6,7 +6,7 @@ * 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. */ diff --git a/ir/tr/type.h b/ir/tr/type.h index 1c2327a98..f5a11c021 100644 --- a/ir/tr/type.h +++ b/ir/tr/type.h @@ -1071,7 +1071,7 @@ void set_array_order (ir_type *array, int dimension, int order); /** Returns the order of an array dimension. */ int get_array_order (const ir_type *array, int dimension); -/** Find the array dimension that is placed at order ord. */ +/** Find the array dimension that is placed at order order. */ int find_array_dimension(const ir_type *array, int order); /** Sets the array element type. */ @@ -1184,13 +1184,13 @@ ir_type *find_pointer_type_to_type (ir_type *tp); * important information they carry is held in the common mode field. */ /** Creates a new primitive type. */ -ir_type *new_type_primitive (ident *name, ir_mode *mode); +ir_type *new_type_primitive(ident *name, ir_mode *mode); /** Creates a new primitive type with debug information. */ -ir_type *new_d_type_primitive (ident *name, ir_mode *mode, dbg_info* db); +ir_type *new_d_type_primitive(ident *name, ir_mode *mode, dbg_info* db); /** Returns true if a type is a primitive type. */ -int is_Primitive_type (const ir_type *primitive); +int is_Primitive_type(const ir_type *primitive); /** diff --git a/ir/tr/type_t.h b/ir/tr/type_t.h index a54850c44..dbbadf4b0 100644 --- a/ir/tr/type_t.h +++ b/ir/tr/type_t.h @@ -130,11 +130,13 @@ typedef union { /** Additional type flags. */ enum type_flags { - tf_none = 0, /**< No flags. */ - tf_frame_type = 1, /**< Set if this is a frame type. */ - tf_value_param_type = 2, /**< Set if this is a value param type. */ - tf_lowered_type = 4, /**< Set if this is a lowered type. */ - tf_layout_fixed = 8 /**< Set if the layout of a type is fixed */ + tf_none = 0, /**< No flags. */ + tf_frame_type = 1, /**< Set if this is a frame type. */ + tf_value_param_type = 2, /**< Set if this is a value param type. */ + tf_lowered_type = 4, /**< Set if this is a lowered type. */ + tf_layout_fixed = 8, /**< Set if the layout of a type is fixed */ + tf_global_type = 16, /**< Set only for the global type */ + tf_tls_type = 32, /**< Set only for the tls type */ }; /** The structure of a type. */ diff --git a/ir/tr/typegmod.c b/ir/tr/typegmod.c index 8b7748b1e..6d2d8da67 100644 --- a/ir/tr/typegmod.c +++ b/ir/tr/typegmod.c @@ -3,22 +3,23 @@ * 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. @@ -40,6 +41,9 @@ void exchange_types(ir_type *old_type, ir_type *new_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) { -- 2.20.1