2 * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
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.
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.
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
22 * @brief Generic backend types and interfaces.
23 * @author Sebastian Hack
26 #ifndef FIRM_BE_MAIN_H
27 #define FIRM_BE_MAIN_H
36 #include <libcore/lc_timing.h>
38 #define LC_STOP_AND_RESET_TIMER(timer) do { lc_timer_stop(timer); lc_timer_reset(timer); } while(0)
41 * This structure contains parameters that should be
42 * propagated to the libFirm parameter set.
44 typedef struct backend_params {
45 /** Additional opcodes settings. */
46 const arch_ops_info *arch_op_settings;
48 /** Settings for architecture dependent optimizations */
49 const arch_dep_params_t *dep_param;
51 /** if set, the backend cannot handle DWORD access */
52 unsigned do_dw_lowering;
54 /** the architecture specific intrinsic function creator */
55 create_intrinsic_fkt *arch_create_intrinsic_fkt;
57 /** the context parameter for the create intrinsic function */
58 void *create_intrinsic_ctx;
60 /** backend settings for if-conversion */
61 const opt_if_conv_info_t *if_conv_info;
65 * Register the Firm backend command line options.
67 void be_opt_register(void);
70 * Parse one backend argument.
72 int be_parse_arg(const char *arg);
75 * Initialize the Firm backend. Must be run BEFORE init_firm()!
77 * @return libFirm configuration parameters for the selected
80 const backend_params *be_init(void);
83 * Main interface to the frontend.
85 void be_main(FILE *file_handle, const char *cup_name);
87 /** The type of the debug info retriever function. */
88 typedef const char *(*retrieve_dbg_func)(const dbg_info *dbg, unsigned *line);
91 * Sets a debug info retriever.
93 * @param func the debug retriever function.
95 void be_set_debug_retrieve(retrieve_dbg_func func);
98 * Retrieve the debug info.
100 const char *be_retrieve_dbg_info(const dbg_info *dbg, unsigned *line);
102 typedef struct be_main_env_t be_main_env_t;
103 typedef struct be_options_t be_options_t;
105 #endif /* FIRM_BE_MAIN_H */