remove license stuff from files
[libfirm] / ir / ir / rm_tuples.c
index dc9f06e..5decefd 100644 (file)
@@ -1,20 +1,6 @@
 /*
- * Copyright (C) 2011 Karlsruhe Institute of Technology.  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 Karlsruhe Institute of Technology.
  */
 
 /**
@@ -57,5 +43,18 @@ static void exchange_tuple_projs(ir_node *node, void *env)
 void remove_tuples(ir_graph *irg)
 {
        irg_walk_graph(irg, exchange_tuple_projs, NULL, NULL);
+
+       ir_node *end          = get_irg_end(irg);
+       int      n_keepalives = get_End_n_keepalives(end);
+       int      i;
+
+       for (i = n_keepalives - 1; i >= 0; --i) {
+               ir_node *irn = get_End_keepalive(end, i);
+
+               if (is_Tuple(irn)) {
+                       remove_End_keepalive(end, irn);
+               }
+       }
+
        add_irg_properties(irg, IR_GRAPH_PROPERTY_NO_TUPLES);
 }