remove_irp_type(irp->glob_type);
remove_irp_type(irp->tls_type);
+ /* set these flags for debugging */
+ irp->glob_type->flags |= tf_global_type;
+ irp->tls_type->flags |= tf_tls_type;
+
irp->const_code_irg = new_const_code_irg();
irp->phase_state = phase_building;
/* frees all memory used by irp. Types in type list, irgs in irg
list and entities in global type must be freed by hand before. */
-void free_ir_prog(void) {
+void free_ir_prog(void) {
if (irp->glob_type)
free_type(irp->glob_type);
if (irp->tls_type)
/* Access the main routine of the compiled program. */
ir_graph *get_irp_main_irg(void) {
- assert (irp);
+ assert(irp);
return irp->main_irg;
}
}
void set_irp_irg(int pos, ir_graph *irg) {
- assert (irp && irg);
- assert (pos < (ARR_LEN(irp->graphs)));
+ assert(irp && irg);
+ assert(pos < (ARR_LEN(irp->graphs)));
irp->graphs[pos] = irg;
}
/* Adds type to the list of types in irp. */
void add_irp_type(ir_type *typ) {
- assert (typ != NULL);
+ assert(typ != NULL);
assert(irp);
ARR_APP1 (ir_type *, irp->types, typ);
}
}
void set_irp_type(int pos, ir_type *typ) {
- assert (irp && typ);
- assert (pos < (ARR_LEN((irp)->types)));
+ assert(irp && typ);
+ assert(pos < (ARR_LEN((irp)->types)));
irp->types[pos] = typ;
}
/* Removes opcode from the list of opcodes and shrinks the list by one. */
void remove_irp_opcode(ir_op *opcode) {
int i;
- assert(opcode);
+ assert(opcode);
for (i = ARR_LEN(irp->opcodes) -1; i >= 0; i--) {
if (irp->opcodes[i] == opcode) {
- for(; i < (ARR_LEN(irp->opcodes)) - 1; i++) {
+ for (; i < (ARR_LEN(irp->opcodes)) - 1; i++) {
irp->opcodes[i] = irp->opcodes[i+1];
}
ARR_SETLEN(ir_op *, irp->opcodes, (ARR_LEN(irp->opcodes)) - 1);
irg_phase_state get_irp_phase_state(void) {
return irp->phase_state;
}
-void set_irp_phase_state(irg_phase_state s) {
+void set_irp_phase_state(irg_phase_state s) {
irp->phase_state = s;
}
irp->outs_state = outs_inconsistent;
}
-void set_irp_ip_outedges(ir_node ** ip_outedges)
-{
+void set_irp_ip_outedges(ir_node ** ip_outedges) {
irp->ip_outedges = ip_outedges;
}
-ir_node** get_irp_ip_outedges(void)
-{
+ir_node** get_irp_ip_outedges(void) {
return irp->ip_outedges;
}
struct ir_prog {
firm_kind kind; /**< must be k_ir_prog */
ident *name; /**< A file name or the like. */
- ir_graph *main_irg; /**< entry point to the compiled program
- @@@ or a list, in case we compile a library or the like? */
- ir_graph **graphs; /**< all graphs in the ir */
- ir_graph **pseudo_graphs; /**< all pseudo graphs in the ir. See pseudo_irg.c */
+ ir_graph *main_irg; /**< The entry point to the compiled program
+ or NULL if no poit exist. */
+ ir_graph **graphs; /**< A list of all graphs in the ir. */
+ ir_graph **pseudo_graphs; /**< A list of all pseudo graphs in the ir. See pseudo_irg.c */
ir_graph *const_code_irg; /**< This ir graph gives the proper environment
to allocate nodes the represent values
of constant entities. It is not meant as
have fields and procedures. */
ir_type *tls_type; /**< The thread local storage type. Must be a struct as it can
only have fields. */
- ir_type **types; /**< all types in the ir */
- ir_mode **modes; /**< all modes in the ir */
- ir_op **opcodes; /**< all opcodes in the ir */
+ ir_type **types; /**< A list of all types in the ir. */
+ ir_mode **modes; /**< A list of all modes in the ir. */
+ ir_op **opcodes; /**< A list of all opcodes in the ir. */
/* -- states of and access to generated information -- */
- irg_phase_state phase_state; /**< State of construction. */
+ irg_phase_state phase_state; /**< The state of construction. */
- ip_view_state ip_view; /**< State of interprocedural view. */
+ ip_view_state ip_view; /**< The state of interprocedural view. */
- irg_outs_state outs_state; /**< State of out edges of ir nodes. */
- ir_node **ip_outedges; /**< Huge Array that contains all out edges
+ irg_outs_state outs_state; /**< The state of out edges of ir nodes. */
+ ir_node **ip_outedges; /**< A huge Array that contains all out edges
in interprocedural view. */
- irg_outs_state trouts_state; /**< State of out edges of type information. */
+ irg_outs_state trouts_state; /**< The state of out edges of type information. */
irg_callee_info_state callee_info_state; /**< Validity of callee information.
- Contains the lowest value or all irgs. */
+ Contains the lowest value or all irgs. */
ir_typeinfo_state typeinfo_state; /**< Validity of type information. */
inh_transitive_closure_state inh_trans_closure_state; /**< trans closure of inh relations. */
- irp_callgraph_state callgraph_state; /**< State of the callgraph. */
+ irp_callgraph_state callgraph_state; /**< The state of the callgraph. */
ir_loop *outermost_cg_loop; /**< For callgraph analysis: entry point
- to looptree over callgraph. */
+ to looptree over callgraph. */
int max_callgraph_loop_depth; /**< needed in callgraph. */
int max_callgraph_recursion_depth; /**< needed in callgraph. */
double max_method_execution_frequency; /**< needed in callgraph. */
irp_temperature_state temperature_state; /**< accumulated temperatures computed? */
- exec_freq_state execfreq_state; /**< State of execution freqency information */
- loop_nesting_depth_state lnd_state; /**< State of loop nesting depth information. */
- ir_class_cast_state class_cast_state; /**< kind of cast operations in code. */
+ exec_freq_state execfreq_state; /**< The state of execution frequency information */
+ loop_nesting_depth_state lnd_state; /**< The state of loop nesting depth information. */
+ ir_class_cast_state class_cast_state; /**< The state of cast operations in code. */
#ifdef DEBUG_libfirm
long max_node_nr; /**< to generate unique numbers for nodes. */