/*
- * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved.
- *
* This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
+ * Copyright (C) 2012 University of Karlsruhe.
*/
/**
void copy_irn_to_irg(ir_node *n, ir_graph *irg)
{
- ir_op *op = get_irn_op(n);
ir_graph *old_irg;
ir_node *nn = NULL;
/* do not copy standard nodes */
- if (op == op_NoMem)
+ switch (get_irn_opcode(n)) {
+ case iro_NoMem:
n = get_irg_no_mem(irg);
- else if (op == op_Block) {
- old_irg = get_irn_irg(n);
+ break;
+ case iro_Block:
+ old_irg = get_irn_irg(n);
if (n == get_irg_start_block(old_irg))
nn = get_irg_start_block(irg);
else if (n == get_irg_end_block(old_irg))
nn = get_irg_end_block(irg);
- }
- else if (op == op_Start)
+ break;
+
+ case iro_Start:
nn = get_irg_start(irg);
- else if (op == op_End)
+ break;
+
+ case iro_End:
nn = get_irg_end(irg);
- else if (op == op_Proj) {
- old_irg = get_irn_irg(n);
+ break;
+ case iro_Proj:
+ old_irg = get_irn_irg(n);
if (n == get_irg_initial_exec(old_irg))
nn = get_irg_initial_exec(irg);
else if (n == get_irg_frame(old_irg))
nn = get_irg_initial_mem(irg);
else if (n == get_irg_args(old_irg))
nn = get_irg_args(irg);
+ break;
}
if (nn) {
nn = new_ir_node(get_irn_dbg_info(n),
irg,
NULL, /* no block yet, will be set later */
- op,
+ get_irn_op(n),
get_irn_mode(n),
get_irn_arity(n),
get_irn_in(n) + 1);
void firm_pset_dump(pset *set)
{
- void *obj;
-
- foreach_pset(set, void*, obj) {
+ foreach_pset(set, void, obj) {
ir_fprintf(stderr, "%+F\n", obj);
}
}