be_init now return parameters for the frontend
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 11 May 2006 16:21:11 +0000 (16:21 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 11 May 2006 16:21:11 +0000 (16:21 +0000)
ir/be/be.h
ir/be/bearch.h
ir/be/bemain.c

index 3df6732..5d04946 100644 (file)
@@ -3,8 +3,29 @@
 #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.
  */
@@ -17,8 +38,11 @@ int be_parse_arg(const char *arg);
 
 /**
  * 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.
index edb58e7..30404e9 100644 (file)
@@ -598,11 +598,17 @@ struct _arch_isa_if_t {
    */
   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
 };
index 8ed05fd..30a0cc4 100644 (file)
@@ -186,8 +186,16 @@ int be_parse_arg(const char *arg) {
 #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();
 
@@ -197,6 +205,10 @@ void be_init(void)
        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)
@@ -364,7 +376,7 @@ static void be_main_loop(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);