/*
- * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
current_ir_graph = graph;
}
-
+#ifdef INTERPROCEDURAL_VIEW
int firm_interprocedural_view = 0;
int (get_interprocedural_view)(void) {
_get_irn_n = _get_irn_intra_n;
}
}
+#endif
/** contains the suffix for frame type names */
static ident *frame_type_suffix = NULL;
add_immBlock_pred(start_block, projX);
set_store(initial_mem);
+ res->index = get_irp_new_irg_idx();
#ifdef DEBUG_libfirm
res->graph_nr = get_irp_new_node_nr();
#endif
- res->proj_args = NULL;
/*
* The code generation needs it. leave it in now.
return _is_ir_graph(thing);
}
-/* Outputs a unique number for this node */
-long get_irg_graph_nr(ir_graph *irg) {
- assert(irg);
#ifdef DEBUG_libfirm
+/* Outputs a unique number for this node */
+long get_irg_graph_nr(const ir_graph *irg) {
return irg->graph_nr;
-#else
- return (long)PTR_TO_INT(irg);
+}
#endif
+
+int get_irg_idx(const ir_graph *irg) {
+ return irg->index;
}
ir_node *
_set_irg_value_param_base(irg, node);
}
-ir_node **
-(get_irg_proj_args) (const ir_graph *irg) {
- return _get_irg_proj_args (irg);
-}
-
-void
-(set_irg_proj_args) (ir_graph *irg, ir_node **nodes) {
- _set_irg_proj_args (irg, nodes);
-}
-
ir_node *
(get_irg_bad)(const ir_graph *irg) {
return _get_irg_bad(irg);
irg->fp_model = model;
}
+/**
+ * walker Start->End: places Proj nodes into the same block
+ * as it's predecessors
+ *
+ * @param n the node
+ * @param env ignored
+ */
+static void normalize_proj_walker(ir_node *n, void *env) {
+ (void) env;
+ if (is_Proj(n)) {
+ ir_node *pred = get_Proj_pred(n);
+ ir_node *block = get_nodes_block(pred);
+
+ set_nodes_block(n, block);
+ }
+}
+
+/* move Proj nodes into the same block as its predecessors */
+void normalize_proj_nodes(ir_graph *irg) {
+ irg_walk_graph(irg, NULL, normalize_proj_walker, NULL);
+ set_irg_outs_inconsistent(irg);
+}
+
/* set a description for local value n */
void set_irg_loc_description(ir_graph *irg, int n, void *description) {
assert(0 <= n && n < irg->n_loc);