bemain: init_graph in arch_isa_if_t may now be a null pointer.
authorChristoph Mallon <christoph.mallon@gmx.de>
Sat, 24 Nov 2012 09:06:09 +0000 (10:06 +0100)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sat, 24 Nov 2012 10:01:33 +0000 (11:01 +0100)
Remove empty init_graph functions from arm and sparc backends.

ir/be/arm/bearch_arm.c
ir/be/bemain.c
ir/be/sparc/bearch_sparc.c

index f64c60f..2b3bcbb 100644 (file)
@@ -273,15 +273,6 @@ static void arm_before_ra(ir_graph *irg)
        be_sched_fix_flags(irg, &arm_reg_classes[CLASS_arm_flags], NULL, NULL);
 }
 
-/**
- * Initializes the code generator.
- */
-static void arm_init_graph(ir_graph *irg)
-{
-       (void) irg;
-}
-
-
 /**
  * Maps all intrinsic calls that the backend support
  * and map all instructions the backend did not support
@@ -578,7 +569,7 @@ const arch_isa_if_t arm_isa_if = {
 
        arm_begin_codegeneration,
        arm_end_codegeneration,
-       arm_init_graph,
+       NULL,
        NULL,  /* get call abi */
        NULL,  /* mark remat */
        NULL,  /* get_pic_base */
index 16e5dd9..26a5148 100644 (file)
@@ -658,7 +658,8 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
                be_timer_pop(T_VERIFY);
 
                /* get a code generator for this graph. */
-               arch_env->impl->init_graph(irg);
+               if (arch_env->impl->init_graph)
+                       arch_env->impl->init_graph(irg);
 
                /* some transformations need to be done before abi introduce */
                if (arch_env->impl->before_abi != NULL)
index ffa479e..d14d118 100644 (file)
@@ -171,11 +171,6 @@ static void sparc_before_ra(ir_graph *irg)
                           NULL, sparc_modifies_fp_flags);
 }
 
-static void sparc_init_graph(ir_graph *irg)
-{
-       (void) irg;
-}
-
 extern const arch_isa_if_t sparc_isa_if;
 static sparc_isa_t sparc_isa_template = {
        {
@@ -635,7 +630,7 @@ const arch_isa_if_t sparc_isa_if = {
 
        sparc_begin_codegeneration,
        sparc_end_codegeneration,
-       sparc_init_graph,
+       NULL,
        NULL,                /* get call abi */
        NULL,                /* mark remat */
        NULL,                /* get_pic_base */