This is the mail archive of the gcc-patches@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: [patch] Move register_pass into passes.c


Changed error()s to gcc_unreachable().

On Sat, Sep 26, 2009 at 3:55 AM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Sat, Sep 26, 2009 at 2:17 AM, Sriraman Tallam <tmsriram@google.com> wrote:
>> Hi,
>>
>> ? ? ?This is a patch to move register_patch into passes.c to make it
>> generic to allow backends to add passes.
>>
>> ? ? ? ?* tree-pass.h (register_pass_info): New structure.
>> ? ? ? ?(pass_positioning_ops): Move enum from gcc-plugin.h.
>> ? ? ? ?(register_pass): New function.
>> ? ? ? ?* gcc-plugin.h (plugin_pass): Delete structure.
>> ? ? ? ?(pass_positioning_ops): Delete enum.
>> ? ? ? ?* plugin.c (regsiter_pass): New function.
>> ? ? ? ?(position_pass): New function.
>> ? ? ? ?(added_pass_nodes): Delete variable.
>> ? ? ? ?(prev_added_pass_nodes): Delete variable.
>> ? ? ? ?(pass_list_node): Delete structure.
>> ? ? ? ?* passes.c (make_pass_instance): New function.
>> ? ? ? ?(next_pass_1): Change to call make_pass_instance.
>> ? ? ? ?(pass_list_node): Move structure from gcc-plugin.h.
>> ? ? ? ?(added_pass_nodes): Move variable from plugin.c.
>> ? ? ? ?(prev_added_pass_nodes): Move variable from plugin.c.
>> ? ? ? ?(position_pass): New function.
>> ? ? ? ?(register_pass): New function.
>>
>> Ran make check.
>
> + ?if (!position_pass (pass_info, &all_lowering_passes)
> + ? ? ?&& !position_pass (pass_info, &all_ipa_passes)
> + ? ? ?&& !position_pass (pass_info, &all_passes))
> + ? ?error ("Failed to position pass %s registered by plugin/backend %s. "
> + ? ? ? ? ? "Cannot find the (specified instance of) reference pass %s",
> + ? ? ? ? ? pass_info->pass->name, disp_name, pass_info->reference_pass_name);
>
> at least the error()s should now become gcc_unreachable()s or
> sorry()s.
>
> In the end I would have preferred to have something like a pass iterator
> and ways to insert/remove passes as a more generic interface than this,
> but for now it's probably ok.
>
> For approval I defer to people who actually care about plugins ;)
>
> Note that for this kind of patches you definitely should do a bootstrap,
> not just make check.
>
> Thanks,
> Richard.
>
>>
>> Thanks,
>> -Sriraman.
>>
>

Attachment: refactor_register_pass.txt
Description: Text document


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