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