Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
b094543f
Commit
b094543f
authored
Apr 04, 2009
by
Michael Beck
Browse files
- updated exchange_types() to use the new type flags
- use the assoc_type for type_id types instead of casting the mode [r25787]
parent
bb9b1067
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/tr/type_t.h
View file @
b094543f
...
...
@@ -140,10 +140,11 @@ 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_lowered_type
=
1
,
/**< Set if this is a lowered type. */
tf_layout_fixed
=
2
,
/**< Set if the layout of a type is fixed */
tf_frame_type
=
4
,
/**< Set if this is a frame type. */
tf_value_param_type
=
8
,
/**< Set if this is a value param type. */
tf_global_type
=
16
,
/**< Set only for the global type */
tf_tls_type
=
32
,
/**< Set only for the tls type */
tf_constructors
=
64
,
/**< Set only for the constructors segment type */
...
...
ir/tr/typegmod.c
View file @
b094543f
...
...
@@ -30,7 +30,7 @@
#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
);
unsigned
flags
=
old_type
->
flags
&
~
(
tf_
lowered_type
|
tf_layout_fixed
);
/* 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.
...
...
@@ -51,7 +51,7 @@ 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
;
old_type
->
assoc_type
=
new_type
;
/* ensure that the frame, value param, global and tls flags
are set right if these types are exchanged */
new_type
->
flags
|=
flags
;
...
...
@@ -60,6 +60,6 @@ void exchange_types(ir_type *old_type, ir_type *new_type) {
ir_type
*
skip_tid
(
ir_type
*
tp
)
{
/* @@@ implement the self cycle killing trick of skip_id(ir_node *) */
while
(
tp
->
type_op
==
type_id
)
tp
=
(
ir_type
*
)
tp
->
mod
e
;
tp
=
tp
->
assoc_typ
e
;
return
tp
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment