Fixed some typos.
[libfirm] / ir / be / TEMPLATE / bearch_TEMPLATE.c
index 91d72aa..035ee58 100644 (file)
@@ -162,14 +162,7 @@ static TEMPLATE_isa_t TEMPLATE_isa_template = {
  */
 static arch_env_t *TEMPLATE_init(FILE *outfile)
 {
-       static int run_once = 0;
-       TEMPLATE_isa_t *isa;
-
-       if (run_once)
-               return NULL;
-       run_once = 1;
-
-       isa = XMALLOC(TEMPLATE_isa_t);
+       TEMPLATE_isa_t *isa = XMALLOC(TEMPLATE_isa_t);
        memcpy(isa, &TEMPLATE_isa_template, sizeof(*isa));
 
        be_emit_init(outfile);
@@ -180,8 +173,6 @@ static arch_env_t *TEMPLATE_init(FILE *outfile)
        return &isa->base;
 }
 
-
-
 /**
  * Closes the output file and frees the ISA structure.
  */
@@ -347,6 +338,16 @@ static int TEMPLATE_get_reg_class_alignment(const arch_register_class_t *cls)
 
 static void TEMPLATE_lower_for_target(void)
 {
+       lower_params_t params = {
+               4,                                     /* def_ptr_alignment */
+               LF_COMPOUND_RETURN | LF_RETURN_HIDDEN, /* flags */
+               ADD_HIDDEN_ALWAYS_IN_FRONT,            /* hidden_params */
+               NULL,                                  /* find pointer type */
+               NULL,                                  /* ret_compound_in_regs */
+       };
+
+       /* lower compound param handling */
+       lower_calls_with_compounds(&params);
 }
 
 static int TEMPLATE_is_mux_allowed(ir_node *sel, ir_node *mux_false,
@@ -367,7 +368,6 @@ static const backend_params *TEMPLATE_get_backend_params(void)
                0,     /* no inline assembly */
                0,     /* no support for Rotl nodes */
                0,     /* 0: little-endian, 1: big-endian */
-               TEMPLATE_lower_for_target,  /* lowering for target */
                NULL,  /* architecture dependent settings, will be set later */
                TEMPLATE_is_mux_allowed,  /* parameter for if conversion */
                NULL,  /* float arithmetic mode */
@@ -401,6 +401,7 @@ static int TEMPLATE_is_valid_clobber(const char *clobber)
 
 const arch_isa_if_t TEMPLATE_isa_if = {
        TEMPLATE_init,
+       TEMPLATE_lower_for_target,
        TEMPLATE_done,
        NULL,                /* handle intrinsics */
        TEMPLATE_get_reg_class_for_mode,