Insert declarations to remove cparser warnings
[libfirm] / ir / opt / opt_manage.h
1 /*
2  * Copyright (C) 2011 Karlsruhe Institute of Technology.  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
20 /**
21  * @file
22  * @brief   Optimization wrapper for specifying requirements
23  * @author  Andreas Zwinkau
24  * @version $Id$
25  */
26 #ifndef FIRM_OPT_MANAGE_H
27 #define FIRM_OPT_MANAGE_H
28
29 #include "config.h"
30
31 #include <stdbool.h>
32
33 #include "irgraph_t.h"
34
35 typedef struct optdesc_t {
36         /**
37          * The short name of the optimization
38          *
39          * Should not contain spaces, since it is used for the dumper filenames.
40          */
41         const char * const name;
42
43         /**
44          * required irg_state for this optimization
45          */
46         ir_graph_state_t requirements;
47
48         /**
49          * The optimization function itself
50          *
51          * @returns  zero by default; set some flags, if you guarantee some irg_state properties
52          **/
53         ir_graph_state_t (*const optimization)(ir_graph *irg);
54 } optdesc_t;
55
56 /** Apply an optimization to an ir graph.
57  *  Assures preconditions, invalidates afterwards, and runs the verifier.
58  *  Might also dump the irg.
59  */
60 void perform_irg_optimization(ir_graph *irg, optdesc_t *opt);
61
62 /** A list of all optimization descriptions
63  * TODO We could put something like this into the API
64  */
65 extern optdesc_t opt_ifconv;
66 extern optdesc_t opt_fpvrp;
67 extern optdesc_t opt_cf;
68 extern optdesc_t opt_deconv;
69 extern optdesc_t opt_simplify_bool;
70 extern optdesc_t opt_code_placement;
71 extern optdesc_t opt_combo;
72 extern optdesc_t opt_loadstore;
73 extern optdesc_t opt_peel_loops;
74 extern optdesc_t opt_unroll_loops;
75 extern optdesc_t opt_invert_loops;
76 extern optdesc_t opt_gcse;
77 extern optdesc_t opt_parallel_mem;
78 extern optdesc_t opt_jumpthread;
79
80 #endif /* FIRM_OPT_MANAGE_H */