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