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
e49a1ac2
Commit
e49a1ac2
authored
Feb 27, 2003
by
Michael Beck
Browse files
More doxygen comments. get_compound_*() functions added (moved from gcc frontend).
[r844]
parent
8ae8e22f
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
ir/tr/type.c
View file @
e49a1ac2
...
...
@@ -1244,6 +1244,46 @@ INLINE int is_atomic_type(type *tp) {
return
(
is_primitive_type
(
tp
)
||
is_pointer_type
(
tp
)
||
is_enumeration_type
(
tp
));
}
/*
* Gets the number of elements in a firm compound type.
*/
int
get_compound_n_members
(
type
*
tp
)
{
int
res
=
0
;
if
(
is_struct_type
(
tp
))
res
=
get_struct_n_members
(
tp
);
else
if
(
is_class_type
(
tp
))
res
=
get_class_n_members
(
tp
);
else
if
(
is_union_type
(
tp
))
res
=
get_union_n_members
(
tp
);
else
assert
(
0
&&
"need struct, union or class for member count"
);
return
res
;
}
/*
* Gets the member of a firm compound type at position pos.
*/
entity
*
get_compound_member
(
type
*
tp
,
int
pos
)
{
entity
*
res
;
if
(
is_struct_type
(
tp
))
res
=
get_struct_member
(
tp
,
pos
);
else
if
(
is_class_type
(
tp
))
res
=
get_class_member
(
tp
,
pos
);
else
if
(
is_union_type
(
tp
))
res
=
get_union_member
(
tp
,
pos
);
else
assert
(
0
&&
"need struct, union or class to get a member"
);
return
res
;
}
INLINE
int
is_compound_type
(
type
*
tp
)
{
assert
(
tp
&&
tp
->
kind
==
k_type
);
return
(
is_class_type
(
tp
)
||
is_struct_type
(
tp
)
||
...
...
ir/tr/type.h
View file @
e49a1ac2
This diff is collapsed.
Click to expand it.
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