Remove the unused facility to register space /in front of/ a node.
[libfirm] / ir / ir / irpass_t.h
1 /*
2  * Copyright (C) 1995-2009 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
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.
10  *
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.
14  *
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
17  * PURPOSE.
18  */
19 #ifndef FIRM_IR_PASS_T_H
20 #define FIRM_IR_PASS_T_H
21
22 /**
23  * @file
24  * @brief     Manager for optimization passes. Private Header
25  * @author    Michael Beck
26  */
27 #include "firm_types.h"
28 #include "firm_common.h"
29 #include "adt/list.h"
30 #include "irpass.h"
31
32 /**
33  * Pass function on an ir_graph.
34  */
35 typedef int (*RUN_ON_IRG_FUNC)(ir_graph *irg, void *ctx);
36
37 /**
38  * Dump function on an ir_graph.
39  */
40 typedef void (*DUMP_ON_IRG_FUNC)(ir_graph *irg, void *ctx, unsigned idx);
41
42 /**
43  * Pass function on an ir_prog.
44  */
45 typedef int (*RUN_ON_IRPROG_FUNC)(ir_prog *prog, void *ctx);
46
47 /**
48  * Dump function on an ir_prog.
49  */
50 typedef void (*DUMP_ON_IRPROG_FUNC)(ir_prog *irg, void *ctx, unsigned idx);
51
52 /**
53  * Init/Term function on an pass.
54  */
55 typedef void (*INIT_TERM_FUNC)(void *ctx);
56
57 /**
58  * An ir_sgraph pass.
59  */
60 struct ir_graph_pass_t {
61         /** The firm kind. */
62         firm_kind          kind;
63
64         /** This function is run on every graph on an ir_prog. */
65         RUN_ON_IRG_FUNC    run_on_irg;
66         RUN_ON_IRG_FUNC    verify_irg;
67         DUMP_ON_IRG_FUNC   dump_irg;
68         /** This function is called if this pass is added. */
69         INIT_TERM_FUNC     add_to_mgr;
70         /** This function is called if this pass is removed. */
71         INIT_TERM_FUNC     rem_from_mgr;
72
73         /** context parameter for this pass */
74         void               *context;
75
76         /** The name of the pass. */
77         const char         *name;
78
79         /** Links all passes. */
80         list_head          list;
81
82         unsigned run_parallel:1;       /**< if set this pass can run parallel on all graphs. */
83 };
84
85 /**
86  * An ir_prog pass.
87  */
88 struct ir_prog_pass_t {
89         /** The firm kind. */
90         firm_kind           kind;
91
92         /** This function is on an ir_prog. */
93         RUN_ON_IRPROG_FUNC  run_on_irprog;
94         RUN_ON_IRPROG_FUNC  verify_irprog;
95         DUMP_ON_IRPROG_FUNC dump_irprog;
96         /** This function is called if this pass is added. */
97         INIT_TERM_FUNC      add_to_mgr;
98         /** This function is called if this pass is removed. */
99         INIT_TERM_FUNC      rem_from_mgr;
100
101         /** context parameter for this pass */
102         void                *context;
103
104         /** The name of the pass. */
105         const char          *name;
106
107         /** Links all passes */
108         list_head           list;
109
110         unsigned is_wrapper:1; /**< set if this is a wrapper pass. */
111 };
112
113 /**
114  * An ir_graph pass manager.
115  */
116 struct ir_graph_pass_manager_t {
117         firm_kind  kind;           /**< The firm kind. */
118         list_head  passes;         /**< The list of passes. */
119         unsigned   n_passes;       /**< Number of added passes. */
120         const char *name;          /**< the name of the manager. */
121         unsigned   run_idx;        /**< The run number for the first pass of this manager. */
122         unsigned   verify_all:1;   /**< Set if every pass should be verified. */
123         unsigned   dump_all:1;     /**< Set if every pass should be dumped. */
124 };
125
126 /**
127  * An ir_prog pass manager.
128  */
129 struct ir_prog_pass_manager_t {
130         firm_kind  kind;           /**< The firm kind. */
131         list_head  passes;         /**< The list of passes. */
132         unsigned   n_passes;       /**< Number of added passes. */
133         const char *name;          /**< the name of the manager. */
134         unsigned   run_idx;        /**< The run number for the first pass of this manager. */
135         unsigned   verify_all:1;   /**< Set if every pass should be verified. */
136         unsigned   dump_all:1;     /**< Set if every pass should be dumped. */
137 };
138
139 /**
140  * Ensure that no verifier is run an ir_prog pass.
141  */
142 int ir_prog_no_verify(ir_prog *prog, void *ctx);
143
144 /**
145  * Ensure that no dumper is run from an ir_prog pass.
146  */
147 void ir_prog_no_dump(ir_prog *prog, void *ctx, unsigned idx);
148
149 #endif