moved be_retrieve_dbg_info() into middleend and rename it to ir_retrieve_dbg_info()
[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 "irarch.h"
30 #include "archop.h"
31 #include "lowering.h"
32
33 #include <libcore/lc_timing.h>
34
35 #define LC_STOP_AND_RESET_TIMER(timer) do { lc_timer_stop(timer); lc_timer_reset(timer); } while(0)
36
37 /**
38  * This structure contains parameters that should be
39  * propagated to the libFirm parameter set.
40  */
41 typedef struct backend_params {
42         /** if set, the backend cannot handle DWORD access */
43         unsigned do_dw_lowering:1;
44         /** if set, the backend supports inline assembly */
45         unsigned support_inline_asm:1;
46
47         /** Additional opcodes settings. */
48         const arch_ops_info *arch_op_settings;
49
50         /** Settings for architecture dependent optimizations */
51         const ir_settings_arch_dep_t *dep_param;
52
53         /** the architecture specific intrinsic function creator */
54         create_intrinsic_fkt *arch_create_intrinsic_fkt;
55
56         /** the context parameter for the create intrinsic function */
57         void *create_intrinsic_ctx;
58
59         /** backend settings for if-conversion */
60         const ir_settings_if_conv_t *if_conv_info;
61 } backend_params;
62
63 /**
64  * Register the Firm backend command line options.
65  */
66 void be_opt_register(void);
67
68 /**
69  * Parse one backend argument.
70  */
71 int be_parse_arg(const char *arg);
72
73 /**
74  * Initialize the Firm backend. Must be run BEFORE init_firm()!
75  *
76  * @return libFirm configuration parameters for the selected
77  *         backend
78  */
79 const backend_params *be_init(void);
80
81 /**
82  * Main interface to the frontend.
83  */
84 void be_main(FILE *file_handle, const char *cup_name);
85
86 typedef struct be_main_env_t be_main_env_t;
87 typedef struct be_options_t  be_options_t;
88
89 #endif /* FIRM_BE_MAIN_H */