*/
FIRM_API ir_type *get_tls_type(void);
-/** Adds type to the list of types in irp. */
-FIRM_API void add_irp_type(ir_type *typ);
-
-/** Removes type from the list of types, deallocates it and
- shrinks the list by one. */
-FIRM_API void remove_irp_type(ir_type *typ);
-
/**
* Returns the number of all types in the irp.
* @deprecated
* Does not touch frame types or types for value params ... */
FIRM_API void type_walk(type_walk_func *pre, type_walk_func *post, void *env);
-/** Touches every type, entity, frame type, and value param type in
- * unspecified order (also all segment types). */
-FIRM_API void type_walk_prog(type_walk_func *pre, type_walk_func *post,
- void *env);
-
/** Walks over all type information reachable from an ir graph.
*
* Walks over all type information reachable from irg, i.e., starts a
env->pic_symbols_type = new_type_struct(NEW_ID("$PIC_SYMBOLS_TYPE"));
env->cup_name = compilation_unit_name;
- remove_irp_type(env->pic_trampolines_type);
- remove_irp_type(env->pic_symbols_type);
set_class_final(env->pic_trampolines_type, 1);
memset(asm_constraint_flags, 0, sizeof(asm_constraint_flags));
*/
static ir_prog *complete_ir_prog(ir_prog *irp, const char *module_name)
{
- ir_segment_t s;
-
#define IDENT(x) new_id_from_chars(x, sizeof(x) - 1)
irp->name = new_id_from_str(module_name);
= new_type_class(IDENT("Constructors"));
irp->segment_types[IR_SEGMENT_DESTRUCTORS]
= new_type_class(IDENT("Destructors"));
- /* Remove these types from type list. Must be treated differently than
- other types. */
- for (s = IR_SEGMENT_FIRST; s <= IR_SEGMENT_LAST; ++s) {
- remove_irp_type(irp->segment_types[s]);
- }
/* Set these flags for debugging. */
irp->segment_types[IR_SEGMENT_GLOBAL]->flags |= tf_global_type;
{
assert(segment <= IR_SEGMENT_LAST);
irp->segment_types[segment] = new_type;
- /* segment types are not in the type list... */
- remove_irp_type(new_type);
}
ir_type *(get_glob_type)(void)
/** Completes ir_prog. */
void init_irprog_2(void);
+/** Adds type to the list of types in irp. */
+FIRM_API void add_irp_type(ir_type *typ);
+
+/** Removes type from the list of types, deallocates it and
+ shrinks the list by one. */
+FIRM_API void remove_irp_type(ir_type *typ);
+
/* Inline functions. */
#define get_irp_n_irgs() get_irp_n_irgs_()
#define get_irp_irg(pos) get_irp_irg_(pos)
firm_none_type = new_type(tpop_none, mode_BAD, NULL);
set_type_size_bytes(firm_none_type, 0);
set_type_state (firm_none_type, layout_fixed);
- remove_irp_type(firm_none_type);
firm_code_type = new_type(tpop_code, mode_ANY, NULL);
set_type_state(firm_code_type, layout_fixed);
- remove_irp_type(firm_code_type);
firm_unknown_type = new_type(tpop_unknown, mode_ANY, NULL);
set_type_size_bytes(firm_unknown_type, 0);
set_type_state (firm_unknown_type, layout_fixed);
- remove_irp_type(firm_unknown_type);
}
void ir_finish_type(void)
res->flags |= tf_frame_type;
- /* Remove type from type list. Must be treated differently than other types. */
- remove_irp_type(res);
-
/* It is not possible to derive from the frame type. Set the final flag. */
set_class_final(res, 1);
irp_free_resources(irp, IRP_RESOURCE_TYPE_VISITED);
}
-void type_walk_prog(type_walk_func *pre, type_walk_func *post, void *env)
-{
- size_t i, n_irgs = get_irp_n_irgs();
- type_or_ent cont;
-
- type_walk(pre, post, env);
-
- for (i = 0; i < n_irgs; ++i) {
- ir_graph *irg = get_irp_irg(i);
- cont.typ = get_irg_frame_type(irg);
- do_type_walk(cont, pre, post, env);
- }
-
- for (i = IR_SEGMENT_FIRST; i <= IR_SEGMENT_LAST; ++i) {
- cont.typ = get_segment_type((ir_segment_t) i);
- if (cont.typ)
- do_type_walk(cont, pre, post, env);
- }
-}
-
void type_walk_irg(ir_graph *irg,
type_walk_func *pre,
type_walk_func *post,