How to update reg_dead notes

Oleg Endo oleg.endo@t-online.de
Tue Feb 24 16:04:00 GMT 2015


On Tue, 2015-02-24 at 16:59 +0100, Georg-Johann Lay wrote:

It doesn't really answer your question, but just as a side note, the
following ...

> +  struct register_pass_info insert_before_bbro =
> +    {
> +      notes_bbro_pass,              /* pass */
> +      "bbro",                       /* reference_pass_name */
> +      1,                            /* ref_pass_instance_number */
> +      PASS_POS_INSERT_BEFORE        /* position */
> +    };
> +
> +  struct register_pass_info insert_before_compgotos =
> +    {
> +      notes_compgotos_pass,         /* pass */
> +      "compgotos",                  /* reference_pass_name */
> +      1,                            /* ref_pass_instance_number */
> +      PASS_POS_INSERT_BEFORE        /* position */
> +    };
> +
> +  struct register_pass_info insert_before_shorten =
> +    {
> +      notes_shorten_pass,           /* pass */
> +      "shorten",                    /* reference_pass_name */
> +      1,                            /* ref_pass_instance_number */
> +      PASS_POS_INSERT_BEFORE        /* position */
> +    };
> +
> +  struct register_pass_info insert_before_final =
> +    {
> +      notes_final_pass,             /* pass */
> +      "final",                      /* reference_pass_name */
> +      1,                            /* ref_pass_instance_number */
> +      PASS_POS_INSERT_BEFORE        /* position */
> +    };
> +
> +  register_pass (&insert_before_bbro);
> +  register_pass (&insert_before_compgotos);
> +  register_pass (&insert_before_shorten);
> +  register_pass (&insert_before_final);

... can be done in 4 lines of code, without all the struct stuff to pass
function arguments.  See also "register_pass" calls in config/sh/sh.c.

Cheers,
Oleg



More information about the Gcc mailing list