2 * Copyright (C) 2011 Karlsruhe Institute of Technology. All right reserved.
4 * This file is part of libFirm.
6 * This file may be distributed and/or modified under the terms of the
7 * GNU General Public License version 2 as published by the Free Software
8 * Foundation and appearing in the file LICENSE.GPL included in the
9 * packaging of this file.
11 * Licensees holding valid libFirm Professional Edition licenses may use
12 * this file in accordance with the libFirm Commercial License.
13 * Agreement provided with the Software.
15 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 * @brief Remove all Tuple nodes from ir graph
22 * @author Andreas Zwinkau
40 static void exchange_tuple_projs(ir_node *node, void *env)
46 if (!is_Proj(node)) return;
48 pred = get_Proj_pred(node);
49 proj = get_Proj_proj(node);
51 if (!is_Tuple(pred)) return;
53 pred = get_Tuple_pred(pred, proj);
57 void remove_tuples(ir_graph *irg)
59 irg_walk_graph(irg, exchange_tuple_projs, NULL, NULL);
60 add_irg_properties(irg, IR_GRAPH_PROPERTY_NO_TUPLES);