API to enable dumping
[libfirm] / ir / opt / opt_manage.h
1 #include "config.h"
2
3 #include <stdbool.h>
4
5 #include "irgraph_t.h"
6
7 typedef struct optdesc_t {
8         /**
9          * The short name of the optimization
10          *
11          * Should not contain spaces, since it is used for the dumper filenames.
12          */
13         const char * const name;
14
15         /**
16          * required irg_state for this optimization
17          */
18         ir_graph_state_t requirements;
19
20         /**
21          * The optimization function itself
22          *
23          * @returns  zero by default; set some flags, if you guarantee some irg_state properties
24          **/
25         ir_graph_state_t (*const optimization)(ir_graph *irg);
26 } optdesc_t;
27
28 void perform_irg_optimization(ir_graph *irg, optdesc_t *opt);