#define _BE_MAIN_H
#include <stdio.h>
+#include "irarch.h"
+#include "archop.h"
+#include "lower_dw.h"
#include "dbginfo.h"
+/**
+ * This structure contains parameters that should be
+ * propagated to the libFirm parameter set.
+ */
+typedef struct backend_params {
+ /** Additional opcodes settings. */
+ const arch_ops_info *arch_op_settings;
+
+ /** Settings for architecture dependent optimizations */
+ const arch_dep_params_t *dep_param;
+
+ /** if set, the backend cannot handle DWORD access */
+ unsigned do_dw_lowering;
+
+ /** the architecture specific intrinsic function creator */
+ create_intrinsic_fkt *arch_create_intrinsic_fkt;
+} backend_params;
+
/**
* Register the Firm backend command line options.
*/
/**
* Initialize the Firm backend. Must be run BEFORE init_firm()!
+ *
+ * @return libFirm configuration parameters for the selected
+ * backend
*/
-void be_init(void);
+const backend_params *be_init(void);
/**
* Main interface to the frontend.
*/
int (*get_reg_class_alignment)(const void *self, const arch_register_class_t *cls);
+ /**
+ * A "static" function, returns the frontend settings
+ * needed for this backend.
+ */
+ const backend_params *(*get_params)(void);
+
#ifdef WITH_LIBCORE
- /**
- * Register command line options for this backend.
- * @param grp The root group.
- */
+ /**
+ * Register command line options for this backend.
+ * @param grp The root group.
+ */
void (*register_options)(lc_opt_entry_t *grp);
#endif
};
#endif /* WITH_LIBCORE */
}
+/** The be parameters returned by default, all off. */
+const static backend_params be_params = {
+ NULL,
+ NULL,
+ 0,
+ NULL,
+};
-void be_init(void)
+/* Initialize the Firm backend. Must be run BEFORE init_firm()! */
+const backend_params *be_init(void)
{
be_opt_register();
be_copy_opt_init();
copystat_init();
phi_class_init();
+
+ if (isa_if->get_params)
+ return isa_if->get_params();
+ return &be_params;
}
static be_main_env_t *be_init_env(be_main_env_t *env, FILE *file_handle)
be_abi_fix_stack_bias(birg.abi);
arch_code_generator_done(birg.cg);
- dump(DUMP_FINAL, irg, "-end", dump_ir_block_graph_sched);
+ dump(DUMP_FINAL, irg, "-end", dump_ir_extblock_graph_sched);
be_abi_free(birg.abi);
// free_ir_graph(irg);