-#if 0
-/* Returns current_ir_graph and set it to the irg of predecessor index
- of node n. */
-static INLINE ir_graph *
-switch_irg (ir_node *n, int index) {
- ir_graph *old_current = current_ir_graph;
-
- if (interprocedural_view) {
- /* Only Filter and Block nodes can have predecessors in other graphs. */
- if (intern_get_irn_op(n) == op_Filter)
- n = get_nodes_Block(n);
- if (intern_get_irn_op(n) == op_Block) {
- ir_node *cfop = skip_Proj(get_Block_cfgpred(n, index));
- if (is_ip_cfop(cfop)) {
- current_ir_graph = get_irn_irg(cfop);
- set_irg_visited(current_ir_graph, get_max_irg_visited());
- }
- }
- }
-
- return old_current;
-}
-
-/* Walks up the stack passing n and then finding the node
- where we walked into the irg n is contained in.
- Here we switch the irg. */
-static ir_graph *
-find_irg_on_stack (ir_node *n) {
- ir_node *m;
- ir_graph *old_current = current_ir_graph;
- int i;
-
- if (interprocedural_view) {
- for (i = tos; i >= 0; i--) {
- if (stack[i] == n) break;
- }
- if (i < 0) i = tos;
-
- assert (i >= 0);
- for (; i >= 0; i--) {
- m = stack[i];
- /*printf(" Visiting %d ", i); DDMN(m);*/
- if (is_ip_cfop(m)) {
- current_ir_graph = get_irn_irg(m);
- break;
- }
- if (intern_get_irn_op(m) == op_Filter) {
- /* Find the corresponding ip_cfop */
- ir_node *pred = stack[i+1];
- int j;
- for (j = 0; j < get_Filter_n_cg_preds(m); j++)
- if (get_Filter_cg_pred(m, j) == pred) break;
- if (j >= get_Filter_n_cg_preds(m))
- /* It is a filter we didn't pass as the predecessors are marked. */
- continue;
- assert(get_Filter_cg_pred(m, j) == pred);
- switch_irg(m, j);
- break;
- }
- }
- }
-
- return old_current;
-}
-#endif
-