removed the get_register_from_name() callback
[libfirm] / include / libfirm / be.h
1 /*
2  * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief       Generic backend types and interfaces.
23  * @author      Sebastian Hack
24  * @version     $Id$
25  */
26 #ifndef FIRM_BE_MAIN_H
27 #define FIRM_BE_MAIN_H
28
29 #include <stdio.h>
30 #include "irarch.h"
31 #include "archop.h"
32 #include "lowering.h"
33 #include "dbginfo.h"
34 #include "iroptimize.h"
35
36 #include <libcore/lc_timing.h>
37
38 #define LC_STOP_AND_RESET_TIMER(timer) do { lc_timer_stop(timer); lc_timer_reset(timer); } while(0)
39
40 /**
41  * This structure contains parameters that should be
42  * propagated to the libFirm parameter set.
43  */
44 typedef struct backend_params {
45         /** if set, the backend cannot handle DWORD access */
46         unsigned do_dw_lowering:1;
47         /** if set, the backend supports inline assembly */
48         unsigned support_inline_asm:1;
49         /** if set, the backend prefers fastcall convention over cdecl */
50         unsigned prefer_fastcall:1;
51
52         /** Additional opcodes settings. */
53         const arch_ops_info *arch_op_settings;
54
55         /** Settings for architecture dependent optimizations */
56         const arch_dep_params_t *dep_param;
57
58         /** the architecture specific intrinsic function creator */
59         create_intrinsic_fkt *arch_create_intrinsic_fkt;
60
61         /** the context parameter for the create intrinsic function */
62         void *create_intrinsic_ctx;
63
64         /** backend settings for if-conversion */
65         const opt_if_conv_info_t *if_conv_info;
66 } backend_params;
67
68 /**
69  * Register the Firm backend command line options.
70  */
71 void be_opt_register(void);
72
73 /**
74  * Parse one backend argument.
75  */
76 int be_parse_arg(const char *arg);
77
78 /**
79  * Initialize the Firm backend. Must be run BEFORE init_firm()!
80  *
81  * @return libFirm configuration parameters for the selected
82  *         backend
83  */
84 const backend_params *be_init(void);
85
86 /**
87  * Main interface to the frontend.
88  */
89 void be_main(FILE *file_handle, const char *cup_name);
90
91 /** The type of the debug info retriever function. */
92 typedef const char *(*retrieve_dbg_func)(const dbg_info *dbg, unsigned *line);
93
94 /**
95  * Sets a debug info retriever.
96  *
97  * @param func   the debug retriever function.
98  */
99 void be_set_debug_retrieve(retrieve_dbg_func func);
100
101 /**
102  * Retrieve the debug info.
103  */
104 const char *be_retrieve_dbg_info(const dbg_info *dbg, unsigned *line);
105
106 typedef struct be_main_env_t be_main_env_t;
107 typedef struct be_options_t  be_options_t;
108
109 #endif /* FIRM_BE_MAIN_H */