# include "ircons.h"
# include "irgraph_t.h"
-# include "irprog.h"
+# include "irprog_t.h"
# include "iropt_t.h"
# include "array.h"
# include "irgmod.h"
# include "mangle.h"
ir_graph *current_ir_graph;
+INLINE ir_graph *get_current_ir_graph() {
+ return current_ir_graph;
+}
+INLINE void set_current_ir_graph(ir_graph *graph) {
+ current_ir_graph = graph;
+}
+
bool interprocedural_view = false;
+INLINE bool get_interprocedural_view() {
+ return interprocedural_view;
+}
+INLINE void set_interprocedural_view(bool state) {
+ interprocedural_view = state;
+}
#if USE_EXPLICIT_PHI_IN_STACK
/* really defined in ircons.c */
ir_graph *
new_ir_graph (entity *ent, int n_loc)
{
+ int i;
ir_graph *res;
ir_node *first_block;
ir_node *projX;
res->outs_state = no_outs;
res->dom_state = no_dom;
- /** Type inforamtion for the procedure of the graph **/
+ /** Type information for the procedure of the graph **/
res->ent = ent;
set_entity_irg(ent, res);
/** A type that represents the stack frame. A class type so that it can
contain "inner" methods as in Pascal. **/
res->frame_type = new_type_class(mangle(get_entity_ident(ent),
- id_from_str(FRAME_TP_SUFFIX, strlen(FRAME_TP_SUFFIX))));
+ id_from_str(FRAME_TP_SUFFIX, strlen(FRAME_TP_SUFFIX))));
+ /* Remove type from type list. Must be treated differently than other types. */
+ remove_irp_type_from_list(res->frame_type);
/** Nodes needed in every graph **/
res->end_block = new_immBlock ();
}
int
-get_irg_n_loc (ir_graph *irg)
+get_irg_n_locs (ir_graph *irg)
{
#if PRECISE_EXC_CONTEXT
return irg->n_loc - 1 - 1;
irg->dom_state = dom_inconsistent;
}
-inline void
-set_irg_pinned (ir_graph *irg, op_pinned p)
-{
+INLINE void
+set_irg_pinned (ir_graph *irg, op_pinned p) {
irg->pinned = p;
}
-/* maximum of all ir_graphs */
-static int max_irg_visited = 0;
+INLINE void
+set_irg_link (ir_graph *irg, void *thing) {
+ irg->link = thing;
+}
+
+INLINE void *
+get_irg_link (ir_graph *irg) {
+ return irg->link;
+}
+/* maximum visited flag content of all ir_graph visited fields. */
+static int max_irg_visited = 0;
unsigned long
get_irg_visited (ir_graph *irg)
set_irg_visited (ir_graph *irg, unsigned long visited)
{
irg->visited = visited;
+ if (irg->visited > max_irg_visited) {
+ max_irg_visited = irg->visited;
+ }
}
void
unsigned long
get_max_irg_visited(void)
{
+ int i;
+ //for(i = 0; i < get_irp_n_irgs(); i++)
+ // assert(max_irg_visited >= get_irg_visited(get_irp_irg(i)));
+ return max_irg_visited;
+}
+
+void set_max_irg_visited(int val) {
+ max_irg_visited = val;
+}
+
+unsigned long
+inc_max_irg_visited(void)
+{
+ int i;
+ // for(i = 0; i < get_irp_n_irgs(); i++)
+ //assert(max_irg_visited >= get_irg_visited(get_irp_irg(i)));
+ max_irg_visited++;
return max_irg_visited;
}