This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to update reg_dead notes


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]