INSERTENUM(tt_builtin, ir_bk_trap);
INSERTENUM(tt_builtin, ir_bk_debugbreak);
INSERTENUM(tt_builtin, ir_bk_return_address);
- INSERTENUM(tt_builtin, ir_bk_frame_addess);
+ INSERTENUM(tt_builtin, ir_bk_frame_address);
INSERTENUM(tt_builtin, ir_bk_prefetch);
INSERTENUM(tt_builtin, ir_bk_ffs);
INSERTENUM(tt_builtin, ir_bk_clz);
static void export_entity(io_env_t *env, ir_entity *ent)
{
ir_type *owner = get_entity_owner(ent);
- fprintf(env->file, "\tentity %ld \"%s\" \"%s\" %ld %ld %d %u %s %s %s %s %s ",
+ fprintf(env->file, "\tentity %ld \"%s\" \"%s\" %ld %ld %d %u %d %s %s %s %s %s ",
get_entity_nr(ent),
get_entity_name(ent),
ent->ld_name ? get_id_str(ent->ld_name) : "",
get_type_nr(owner),
get_entity_offset(ent),
(unsigned) get_entity_offset_bits_remainder(ent),
+ is_entity_compiler_generated(ent),
get_allocation_name(get_entity_allocation(ent)),
get_visibility_name(get_entity_visibility(ent)),
get_variability_name(get_entity_variability(ent)),
}
}
+/**
+ * Walker: exports every node.
+ */
static void export_node(ir_node *irn, void *ctx)
{
io_env_t *env = (io_env_t *) ctx;
if (env->ignoreblocks && opcode == iro_Block)
return;
- n = get_irn_arity(irn);
-
fprintf(env->file, "\t%s %ld [ ", get_irn_opname(irn), get_irn_node_nr(irn));
+ n = get_irn_arity(irn);
for (i = -1; i < n; i++) {
ir_node *pred = get_irn_n(irn, i);
if (pred == NULL) {
fprintf(env->file, "] { ");
- switch (opcode)
- {
+ switch (opcode) {
#include "gen_irio_export.inl"
}
fputs("}\n", env->file);
fputs("}\n\n", env->file);
}
-/** Exports the whole irp to the given file in a textual form. */
+/* Exports the whole irp to the given file in a textual form. */
void ir_export(const char *filename)
{
io_env_t env;
fputs("typegraph {\n", env.file);
- type_walk_plus_frames(export_type_or_ent_pre, export_type_or_ent_post, &env);
- /* TODO: Visit frame types and "types for value params"? */
+ type_walk_prog(export_type_or_ent_pre, export_type_or_ent_post, &env);
for (i = 0; i < n_irgs; i++) {
ir_graph *irg = get_irp_irg(i);
fclose(env.file);
}
-/** Exports the given irg to the given file. */
+/* Exports the given irg to the given file. */
void ir_export_irg(ir_graph *irg, const char *filename)
{
io_env_t env;
irg_walk_anchors(irg, NULL, export_node, &env);
/* TODO: Only output needed constants */
- fputs("}\n\nconstirg {\n", env.file);
+ fprintf(env.file, "}\n\nconstirg %ld {\n", get_irn_node_nr(get_const_code_irg()->current_block));
walk_const_code(NULL, export_node, &env);
fputs("}\n", env.file);
}
case tpo_class:
- type = new_type_class(id);
+ if(typenr == (long) IR_SEGMENT_GLOBAL)
+ type = get_glob_type();
+ else
+ type = new_type_class(id);
set_type_size_bytes(type, size);
break;
}
case tpo_struct:
- type = new_type_struct(id);
+ if(typenr < (long) IR_SEGMENT_COUNT)
+ type = get_segment_type((ir_segment_t) typenr);
+ else
+ type = new_type_struct(id);
set_type_size_bytes(type, size);
break;
set_entity_ld_ident(entity, new_id_from_str(ld_name));
set_entity_offset (entity, (int) read_long(env));
set_entity_offset_bits_remainder(entity, (unsigned char) read_long(env));
+ set_entity_compiler_generated(entity, (int) read_long(env));
set_entity_allocation (entity, read_allocation(env));
set_entity_visibility (entity, read_visibility(env));
set_entity_variability(entity, read_variability(env));
ir_mode_arithmetic arith = read_mode_arithmetic(env);
unsigned modulo_shift = read_long(env);
int vector_elems = read_long(env);
+ ir_mode *mode;
- ir_mode *mode = new_ir_mode(name, sort, size, sign, arith, modulo_shift);
+ if (vector_elems != 1) {
+ panic("no support for import of vector modes yes");
+ }
- if (mode_is_reference(mode))
- {
+ mode = new_ir_mode(name, sort, size, sign, arith, modulo_shift);
+ if (mode_is_reference(mode)) {
set_reference_mode_signed_eq(mode, read_mode(env));
set_reference_mode_unsigned_eq(mode, read_mode(env));
}