projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
used the new ir_entity type
[libfirm]
/
ir
/
tr
/
typegmod.c
diff --git
a/ir/tr/typegmod.c
b/ir/tr/typegmod.c
index
a1cb01b
..
6d2d8da
100644
(file)
--- 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
* 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$
* Created:
* CVS-ID: $Id$
- * Copyright: (c) 2001-200
3
Universität Karlsruhe
+ * Copyright: (c) 2001-200
6
Universität Karlsruhe
* Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
* 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"
-INLINE void exchange_types(type *old_type, type *new_type) {
+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.
/* 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.
@@
-32,19
+33,22
@@
INLINE void exchange_types(type *old_type, type *new_type) {
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?
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 eventuall
e
+ * Deallocation: if the Id is removed from the list it will eventuall
y
disappear in a memory leak. When is impossible to determine so we
disappear in a memory leak. When is impossible to determine so we
- need to hold it in a sep
e
rate list for deallocation.
+ need to hold it in a sep
a
rate list for deallocation.
*/
/* Exchange the types */
old_type->type_op = type_id;
old_type->mode = (ir_mode *) 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;
}
}
-
INLINE type *skip_tid(
type *tp) {
+
ir_type *skip_tid(ir_
type *tp) {
/* @@@ implement the self cycle killing trick of skip_id(ir_node *) */
while (tp->type_op == type_id)
/* @@@ implement the self cycle killing trick of skip_id(ir_node *) */
while (tp->type_op == type_id)
- tp = (type *) tp->mode;
+ tp = (
ir_
type *) tp->mode;
return tp;
}
return tp;
}