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
033fb743
Commit
033fb743
authored
Feb 17, 2009
by
Moritz Kroll
Browse files
Added has_entity_initializer() and get_initializer_kind_name()
[r25517]
parent
21d88871
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/libfirm/typerep.h
View file @
033fb743
...
...
@@ -444,6 +444,9 @@ typedef enum ir_initializer_kind_t {
/** returns kind of an initializer */
ir_initializer_kind_t
get_initializer_kind
(
const
ir_initializer_t
*
initializer
);
/** Return the name of the initializer kind. */
const
char
*
get_initializer_kind_name
(
ir_initializer_kind_t
ini
);
/**
* returns the null initializer (there's only one instance of it in a program )
*/
...
...
@@ -548,6 +551,9 @@ void set_compound_ent_value(ir_entity *ent, ir_node *val, ir_entity *member, int
/** Sets the new style initializers of an entity. */
void
set_entity_initializer
(
ir_entity
*
entity
,
ir_initializer_t
*
initializer
);
/** Returns true, if an entity has new style initializers. */
int
has_entity_initializer
(
const
ir_entity
*
entity
);
/** Return the new style initializers of an entity. */
ir_initializer_t
*
get_entity_initializer
(
const
ir_entity
*
entity
);
...
...
ir/tr/entity.c
View file @
033fb743
...
...
@@ -679,6 +679,20 @@ ir_node *copy_const_value(dbg_info *dbg, ir_node *n) {
return
nn
;
}
/* copy_const_value */
/** Return the name of the initializer kind. */
const
char
*
get_initializer_kind_name
(
ir_initializer_kind_t
ini
)
{
#define X(a) case a: return #a
switch
(
ini
)
{
X
(
IR_INITIALIZER_CONST
);
X
(
IR_INITIALIZER_TARVAL
);
X
(
IR_INITIALIZER_NULL
);
X
(
IR_INITIALIZER_COMPOUND
);
default:
return
"BAD VALUE"
;
}
#undef X
}
static
ir_initializer_t
null_initializer
=
{
IR_INITIALIZER_NULL
};
ir_initializer_t
*
get_initializer_null
(
void
)
...
...
@@ -783,6 +797,11 @@ void set_entity_initializer(ir_entity *entity, ir_initializer_t *initializer)
check_entity_initializer
(
entity
);
}
int
has_entity_initializer
(
const
ir_entity
*
entity
)
{
return
entity
->
has_initializer
;
}
ir_initializer_t
*
get_entity_initializer
(
const
ir_entity
*
entity
)
{
assert
(
entity
->
has_initializer
);
...
...
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