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
b4116a3d
Commit
b4116a3d
authored
Jul 12, 2001
by
Boris Boesler
Browse files
added functions set_type_link and get_type_link
[r230]
parent
b636c7a7
Changes
3
Hide whitespace changes
Inline
Side-by-side
ir/tr/type.c
View file @
b4116a3d
...
...
@@ -59,6 +59,7 @@ new_type(tp_op *type_op, ir_mode *mode, ident* name) {
res
->
state
=
layout_undefined
;
res
->
size
=
-
1
;
res
->
visit
=
0
;
res
->
link
=
NULL
;
return
res
;
}
...
...
@@ -77,6 +78,19 @@ void free_type_attrs(type *tp) {
}
}
/* set/get the link field */
void
*
get_type_link
(
type
*
tp
)
{
assert
(
tp
);
return
(
tp
->
link
);
}
void
set_type_link
(
type
*
tp
,
void
*
l
)
{
assert
(
tp
);
tp
->
link
=
l
;
}
tp_op
*
get_type_tpop
(
type
*
tp
)
{
assert
(
tp
);
return
tp
->
type_op
;
...
...
@@ -250,6 +264,7 @@ void remove_class_subtype(type *clss, type *subtype) {
void
add_class_supertype
(
type
*
clss
,
type
*
supertype
)
{
assert
(
clss
&&
(
clss
->
type_op
==
type_class
));
assert
(
supertype
&&
(
supertype
->
type_op
==
type_class
));
ARR_APP1
(
type
*
,
clss
->
attr
.
ca
.
supertypes
,
supertype
);
ARR_APP1
(
type
*
,
supertype
->
attr
.
ca
.
subtypes
,
clss
);
}
...
...
ir/tr/type.h
View file @
b4116a3d
...
...
@@ -92,6 +92,8 @@ typedef struct ir_node ir_node;
*/
typedef
struct
type
type
;
void
*
get_type_link
(
type
*
tp
);
void
set_type_link
(
type
*
tp
,
void
*
l
);
tp_op
*
get_type_tpop
(
type
*
tp
);
ident
*
get_type_tpop_nameid
(
type
*
tp
);
const
char
*
get_type_tpop_name
(
type
*
tp
);
...
...
ir/tr/type_t.h
View file @
b4116a3d
...
...
@@ -103,6 +103,7 @@ struct type {
when fixing the layout of this class. Size must be
given in bytes. */
unsigned
long
visit
;
/* visited counter for walks of the type information */
void
*
link
;
/* holds temporary data - like in irnode_t.h */
tp_attr
attr
;
/* type kind specific fields. This must be the last
entry in this struct! Varying size! */
};
...
...
Write
Preview
Supports
Markdown
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