Do not mark the transformed as visited. It makes no sense at all.
[libfirm] / ir / be / ppc32 / bearch_ppc32.c
index 40644a0..60992aa 100644 (file)
@@ -264,7 +264,7 @@ typedef struct
  */
 static void *ppc32_abi_init(const be_abi_call_t *call, const arch_env_t *aenv, ir_graph *irg)
 {
-       ppc32_abi_env *env = xmalloc(sizeof(ppc32_abi_env));
+       ppc32_abi_env *env = XMALLOC(ppc32_abi_env);
        (void) aenv;
 
        env->call = call;
@@ -322,22 +322,25 @@ static void ppc32_abi_regs_saved_by_me(void *self, pset *regs)
 
 /**
  * Generate the prologue.
- * @param self    The callback object.
- * @param mem     A pointer to the mem node. Update this if you define new memory.
- * @param reg_map A mapping mapping all callee_save/ignore/parameter registers to their defining nodes.
+ * @param self       The callback object.
+ * @param mem        A pointer to the mem node. Update this if you define new memory.
+ * @param reg_map    A mapping mapping all callee_save/ignore/parameter registers to their defining nodes.
+ * @param stack_bias Points to the current stack bias, can be modified if needed.
+ *
  * @return        The register which shall be used as a stack frame base.
  *
  * All nodes which define registers in @p reg_map must keep @p reg_map current.
  */
-static const arch_register_t *ppc32_abi_prologue(void *self, ir_node **mem, pmap *reg_map)
+static const arch_register_t *ppc32_abi_prologue(void *self, ir_node **mem, pmap *reg_map, int *stack_bias)
 {
        ppc32_abi_env *env = (ppc32_abi_env *) self;
        be_abi_call_flags_t flags = be_abi_call_get_flags(env->call);
        (void) mem;
        (void) reg_map;
+       (void) stack_bias;
        isleaf = flags.bits.irg_is_leaf;
 
-       if(flags.bits.try_omit_fp)
+       if (flags.bits.try_omit_fp)
                return &ppc32_gp_regs[REG_R1];
        else
                return &ppc32_gp_regs[REG_R31];
@@ -603,7 +606,7 @@ static const arch_code_generator_if_t ppc32_code_gen_if = {
  */
 static void *ppc32_cg_init(be_irg_t *birg) {
        ppc32_isa_t      *isa = (ppc32_isa_t *)birg->main_env->arch_env;
-       ppc32_code_gen_t *cg  = xmalloc(sizeof(*cg));
+       ppc32_code_gen_t *cg  = XMALLOC(ppc32_code_gen_t);
 
        cg->impl      = &ppc32_code_gen_if;
        cg->irg       = birg->irg;
@@ -676,7 +679,7 @@ static arch_env_t *ppc32_init(FILE *file_handle) {
        if (inited)
                return NULL;
 
-       isa = xmalloc(sizeof(*isa));
+       isa = XMALLOC(ppc32_isa_t);
        memcpy(isa, &ppc32_isa_template, sizeof(*isa));
 
        be_emit_init(file_handle);
@@ -887,14 +890,14 @@ static const be_execution_unit_t ***ppc32_get_allowed_execution_units(const void
        (void) self;
        (void) irn;
        /* TODO */
-       assert(0);
+       panic("Unimplemented ppc32_get_allowed_execution_units()");
        return NULL;
 }
 
 static const be_machine_t *ppc32_get_machine(const void *self) {
        (void) self;
        /* TODO */
-       assert(0);
+       panic("Unimplemented ppc32_get_machine()");
        return NULL;
 }
 
@@ -926,6 +929,22 @@ static const backend_params *ppc32_get_libfirm_params(void) {
        return &p;
 }
 
+static asm_constraint_flags_t ppc32_parse_asm_constraint(const void *self, const char **c)
+{
+       /* no asm support yet */
+       (void) self;
+       (void) c;
+       return ASM_CONSTRAINT_FLAG_INVALID;
+}
+
+static int ppc32_is_valid_clobber(const void *self, const char *clobber)
+{
+       /* no asm support yet */
+       (void) self;
+       (void) clobber;
+       return 0;
+}
+
 const arch_isa_if_t ppc32_isa_if = {
        ppc32_init,
        ppc32_done,
@@ -941,6 +960,9 @@ const arch_isa_if_t ppc32_isa_if = {
        ppc32_get_allowed_execution_units,
        ppc32_get_machine,
        ppc32_get_irg_list,
+       NULL,                 /* mark remat */
+       ppc32_parse_asm_constraint,
+       ppc32_is_valid_clobber
 };
 
 void be_init_arch_ppc32(void)