Commit 563a25a0 authored by Götz Lindenmaier's avatar Götz Lindenmaier
Browse files

more phase handling: irp_state

[r5328]
parent eba41476
......@@ -25,6 +25,7 @@
#include <string.h>
#endif
# include "irprog_t.h"
# include "irgraph_t.h"
# include "irnode_t.h"
# include "irmode_t.h"
......@@ -2559,10 +2560,21 @@ init_cons(uninitialized_local_variable_func_t *func)
/* call for each graph */
void
finalize_cons (ir_graph *irg) {
irg_finalize_cons (ir_graph *irg) {
irg->phase_state = phase_high;
}
void
irp_finalize_cons (void) {
int i, n_irgs = get_irp_n_irgs();
for (i = 0; i < n_irgs; i++) {
irg_finalize_cons(get_irp_irg(i));
}
irp->phase_state = phase_high;\
}
ir_node *new_Block(int arity, ir_node **in) {
return new_d_Block(NULL, arity, in);
......
......@@ -3813,7 +3813,13 @@ type *get_cur_frame_type(void);
/* --- initialize and finalize ir construction --- */
/** Puts the graph into state "phase_high" */
void finalize_cons (ir_graph *irg);
void irg_finalize_cons (ir_graph *irg);
/** Puts the program and all graphs into state phase_high.
*
* This also remarks, the construction of types is finished,
* e.g., that no more subtypes will be added. */
void irp_finalize_cons(void);
/* --- Initialization --- */
......
......@@ -244,6 +244,13 @@ ir_graph *(get_const_code_irg)(void)
return __get_const_code_irg();
}
irg_phase_state get_irp_phase_state(void) {
return irp->phase_state;
}
void set_irp_phase_state(irg_phase_state s) {
irp->phase_state = s;
}
irg_outs_state get_irp_ip_outs_state() {
return irp->outs_state;
}
......
......@@ -163,6 +163,18 @@ void set_irp_type(int pos, type *typ);
*/
ir_graph *get_const_code_irg(void);
/** The phase state for the program.
*
* The phase state of the whole program is
* building: if at least one graph is state_building
* or one type is incomplete.
* high: all graphs are in state high or low, all types are constructed.
* low: all graphs are in state low, all types are in state layout fixed.
*/
irg_phase_state get_irp_phase_state(void);
void set_irp_phase_state(irg_phase_state s);
irg_outs_state get_irp_ip_outs_state(void);
void set_irp_ip_outs_inconsistent(void);
......
......@@ -30,6 +30,7 @@
#include "irtypeinfo.h"
#include "callgraph.h"
#include "field_temperature.h"
#include "array.h"
......@@ -50,6 +51,7 @@ struct ir_prog {
type **types; /**< all types in the ir */
/* -- states of and access to generated information -- */
irg_phase_state phase_state; /**< State of construction. */
ip_view_state ip_view; /**< State of interprocedural view. */
......@@ -68,6 +70,7 @@ struct ir_prog {
int max_callgraph_loop_depth; /**< needed in callgraph. */
int max_callgraph_recursion_depth; /**< needed in callgraph. */
int max_method_execution_frequency; /**< needed in callgraph. */
irp_temperature_state temperature_state; /**< accumulated temperatures computed? */
#ifdef DEBUG_libfirm
long max_node_nr; /**< to generate unique numbers for nodes. */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment