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
04ef9a5a
Commit
04ef9a5a
authored
Oct 19, 2014
by
Christoph Mallon
Browse files
type: Centralise initialising the name of compound types.
parent
255acfca
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/tr/type.c
View file @
04ef9a5a
...
...
@@ -347,8 +347,9 @@ void (set_type_dbg_info)(ir_type *tp, type_dbg_info *db)
set_type_dbg_info_
(
tp
,
db
);
}
static
void
compound_init
(
ir_type
*
typ
e
)
static
void
compound_init
(
ir_type
*
const
type
,
ident
*
const
nam
e
)
{
type
->
name
=
name
;
type
->
attr
.
ca
.
members
=
NEW_ARR_F
(
ir_entity
*
,
0
);
}
...
...
@@ -406,8 +407,7 @@ static void compound_remove_member(ir_type *type, const ir_entity *member)
ir_type
*
new_type_class
(
ident
*
name
)
{
ir_type
*
res
=
new_type
(
type_class
,
NULL
);
res
->
name
=
name
;
compound_init
(
res
);
compound_init
(
res
,
name
);
res
->
attr
.
cla
.
subtypes
=
NEW_ARR_F
(
ir_type
*
,
0
);
res
->
attr
.
cla
.
supertypes
=
NEW_ARR_F
(
ir_type
*
,
0
);
hook_new_type
(
res
);
...
...
@@ -601,8 +601,7 @@ void set_class_mode(ir_type *tp, ir_mode *mode)
ir_type
*
new_type_struct
(
ident
*
name
)
{
ir_type
*
res
=
new_type
(
type_struct
,
NULL
);
res
->
name
=
name
;
compound_init
(
res
);
compound_init
(
res
,
name
);
hook_new_type
(
res
);
return
res
;
}
...
...
@@ -842,8 +841,7 @@ int (is_Method_type)(const ir_type *method)
ir_type
*
new_type_union
(
ident
*
name
)
{
ir_type
*
res
=
new_type
(
type_union
,
NULL
);
res
->
name
=
name
;
compound_init
(
res
);
compound_init
(
res
,
name
);
hook_new_type
(
res
);
return
res
;
}
...
...
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