+static void write_initializer(io_env_t *env, ir_initializer_t *ini)
+{
+ FILE *f = env->file;
+ ir_initializer_kind_t ini_kind = get_initializer_kind(ini);
+ fputs(get_initializer_kind_name(ini_kind), f);
+ fputc(' ', f);
+
+ switch(ini_kind)
+ {
+ case IR_INITIALIZER_CONST:
+ fprintf(f, "%ld ", get_irn_node_nr(get_initializer_const_value(ini)));
+ break;
+
+ case IR_INITIALIZER_TARVAL:
+ write_tarval(env, get_initializer_tarval_value(ini));
+ break;
+
+ case IR_INITIALIZER_NULL:
+ break;
+
+ case IR_INITIALIZER_COMPOUND:
+ {
+ unsigned i, n = get_initializer_compound_n_entries(ini);
+ fprintf(f, "%d ", n);
+ for(i = 0; i < n; i++)
+ write_initializer(env, get_initializer_compound_value(ini, i));
+ break;
+ }
+
+ default:
+ panic("Unknown initializer kind");
+ }
+}
+