Use new scope instead of empty statement.
[libfirm] / ir / ir / irpass.c
index 705eb5b..88c3454 100644 (file)
@@ -1,20 +1,6 @@
 /*
- * Copyright (C) 1995-2010 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.
  */
 
 /**
@@ -156,17 +142,11 @@ void ir_prog_pass_mgr_add_graph_mgr(
        ir_prog_pass_mgr_add(mgr, pass);
 }
 
-static void create_suffix(char *suffix, size_t n, const char *pass_name)
-{
-       snprintf(suffix, n, "%s.svg", pass_name);
-}
-
 int ir_graph_pass_mgr_run(ir_graph_pass_manager_t *mgr)
 {
-       ir_graph_pass_t *pass;
-       size_t           i;
-       int              res = 0;
-       ir_graph        *rem = current_ir_graph;
+       size_t    i;
+       int       res = 0;
+       ir_graph *rem = current_ir_graph;
 
        /* on all graphs: beware: number of irgs might be changed */
        for (i = 0; i < get_irp_n_irgs(); ++i) {
@@ -190,9 +170,7 @@ int ir_graph_pass_mgr_run(ir_graph_pass_manager_t *mgr)
                                if (pass->dump_irg) {
                                        pass->dump_irg(irg, pass->context, idx);
                                } else {
-                                       char buf[1024];
-                                       create_suffix(buf, sizeof(buf), pass->name);
-                                       dump_ir_graph(irg, buf);
+                                       dump_ir_graph(irg, pass->name);
                                }
                        }
                        ++idx;
@@ -218,8 +196,7 @@ static int irp_verify_irgs(void)
 
 int ir_prog_pass_mgr_run(ir_prog_pass_manager_t *mgr)
 {
-       ir_prog_pass_t *pass;
-       int            res = 0;
+       int res = 0;
 
        /* run every pass on every graph */
        unsigned idx = mgr->run_idx;
@@ -240,9 +217,7 @@ int ir_prog_pass_mgr_run(ir_prog_pass_manager_t *mgr)
                        if (pass->dump_irprog) {
                                pass->dump_irprog(irp, pass->context, idx);
                        } else {
-                               char buf[1024];
-                               create_suffix(buf, sizeof(buf), pass->name);
-                               dump_all_ir_graphs(buf);
+                               dump_all_ir_graphs(pass->name);
                        }
                }
                if (pass->is_wrapper) {
@@ -286,8 +261,6 @@ ir_prog_pass_manager_t *new_prog_pass_mgr(
 
 void term_graph_pass_mgr(ir_graph_pass_manager_t *mgr)
 {
-       ir_graph_pass_t *pass, *next;
-
        list_for_each_entry_safe(ir_graph_pass_t, pass, next, &mgr->passes, list) {
                if (pass->rem_from_mgr)
                        pass->rem_from_mgr(pass->context);
@@ -300,8 +273,6 @@ void term_graph_pass_mgr(ir_graph_pass_manager_t *mgr)
 
 void term_prog_pass_mgr(ir_prog_pass_manager_t *mgr)
 {
-       ir_prog_pass_t *pass, *next;
-
        list_for_each_entry_safe(ir_prog_pass_t, pass, next, &mgr->passes, list) {
                if (pass->rem_from_mgr)
                        pass->rem_from_mgr(pass->context);