/** 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 )
*/
/** 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);
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)
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);