-
-/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer
-**
-** irgmod: ir graph modification
-*/
-
-/* $Id$ */
+/*
+ * Project: libFIRM
+ * File name: ir/ir/irgmod.h
+ * Purpose: Support for ir graph modification.
+ * Author: Martin Trapp, Christian Schaefer
+ * Modified by: Goetz Lindenmaier
+ * Created:
+ * CVS-ID: $Id$
+ * Copyright: (c) 1998-2003 Universität Karlsruhe
+ * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+ */
#ifdef HAVE_CONFIG_H
# include <config.h>
INLINE void
exchange (ir_node *old, ir_node *nw)
{
+ assert(get_irn_op(old)->opar != oparity_dynamic);
ir_node *block = old->in[0];
old->op = op_Id;
/* Functionality for collect_phis */
/**********************************************************************/
-void
+static void
clear_link (ir_node *n, void *env) {
set_irn_link(n, NULL);
}
-void
+static void
collect (ir_node *n, void *env) {
ir_node *pred;
if (get_irn_op(n) == op_Phi) {
/* Moves node and all predecessors of node from from_bl to to_bl.
Does not move predecessors of Phi nodes (or block nodes). */
-void move (ir_node *node, ir_node *from_bl, ir_node *to_bl) {
+static void move (ir_node *node, ir_node *from_bl, ir_node *to_bl) {
int i;
ir_node *proj, *pred;
ir_node *in[1];
in[0] = new_Jmp();
set_irn_in(old_block, 1, in);
- irn_vrfy(old_block);
+ irn_vrfy_irg(old_block, current_ir_graph);
}
/* move node and its predecessors to new_block */
set_irn_link(new_block, phi);
set_irn_link(old_block, NULL);
while (phi) {
- set_nodes_Block(phi, new_block);
+ if(get_nodes_Block(phi) == old_block); /* @@@ inlinening chokes on phis that don't
+ obey this condition. How do they get into
+ the list??? Example: InterfaceIII */
+ set_nodes_Block(phi, new_block);
phi = get_irn_link(phi);
}