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