fixed out-flags parsing
[libfirm] / ir / be / be.h
1 #ifndef _BE_MAIN_H
2 #define _BE_MAIN_H
3
4 #include <stdio.h>
5 #include "irarch.h"
6 #include "archop.h"
7 #include "lower_dw.h"
8 #include "dbginfo.h"
9 #include "ifconv.h"
10
11 #ifdef WITH_LIBCORE
12 #include <libcore/lc_opts.h>
13 #include <libcore/lc_opts_enum.h>
14 #include <libcore/lc_timing.h>
15 #endif /* WITH_LIBCORE */
16
17 #define LC_STOP_AND_RESET_TIMER(timer) do { lc_timer_stop(timer); lc_timer_reset(timer); } while(0)
18
19 /**
20  * This structure contains parameters that should be
21  * propagated to the libFirm parameter set.
22  */
23 typedef struct backend_params {
24         /** Additional opcodes settings. */
25         const arch_ops_info *arch_op_settings;
26
27         /** Settings for architecture dependent optimizations */
28         const arch_dep_params_t *dep_param;
29
30         /** if set, the backend cannot handle DWORD access */
31         unsigned do_dw_lowering;
32
33         /** the architecture specific intrinsic function creator */
34         create_intrinsic_fkt *arch_create_intrinsic_fkt;
35
36         /** the context parameter for the create intrinsic function */
37         void *create_intrinsic_ctx;
38
39         /** backend settings for if-conversion */
40         const opt_if_conv_info_t *if_conv_info;
41 } backend_params;
42
43 /**
44  * Register the Firm backend command line options.
45  */
46 void be_opt_register(void);
47
48 /**
49  * Parse one backend argument.
50  */
51 int be_parse_arg(const char *arg);
52
53 /**
54  * Initialize the Firm backend. Must be run BEFORE init_firm()!
55  *
56  * @return libFirm configuration parameters for the selected
57  *         backend
58  */
59 const backend_params *be_init(void);
60
61 /**
62  * Main interface to the frontend.
63  */
64 void be_main(FILE *file_handle, const char *cup_name);
65
66 /** The type of the debug info retriever function. */
67 typedef const char *(*retrieve_dbg_func)(const dbg_info *dbg, unsigned *line);
68
69 /**
70  * Sets a debug info retriever.
71  *
72  * @param func   the debug retriever function.
73  */
74 void be_set_debug_retrieve(retrieve_dbg_func func);
75
76 /**
77  * Retrieve the debug info.
78  */
79 const char *be_retrieve_dbg_info(const dbg_info *dbg, unsigned *line);
80
81 typedef struct _be_main_env_t be_main_env_t;
82 typedef struct _be_options_t be_options_t;
83
84 #endif /* _BE_MAIN_H */