This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch 1/2][ipa] Add target hook to sanitize cloned declaration's attributes
- From: Martin Jambor <mjambor at suse dot cz>
- To: "Andre Vieira \(lists\)" <andre dot simoesdiasvieira at arm dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc:
- Date: Tue, 08 Oct 2019 18:27:44 +0200
- Subject: Re: [Patch 1/2][ipa] Add target hook to sanitize cloned declaration's attributes
- References: <78b498f6-b5bd-1a59-5ec7-1883e31ea633@arm.com>
Hi,
On Tue, Oct 08 2019, Andre Vieira (lists) wrote:
> Hi,
>
> This patch adds a new target hook called
> TARGET_HOOK_SANITIZE_CLONE_ATTRIBUTES. This hook is meant to give each
> target the ability to sanitize a cloned's declaration attribute list.
>
>
> Is this OK for trunk?
>
> Cheers,
> Andre
>
> gcc/ChangeLog:
>
> 2019-10-08 Andre Vieira <andre.simoesdiasvieira@arm.com>
>
> * ipa-cp.c(create_specialized_node): Call new target hook when
> creating a new node.
I'm quite sure you don't want to call the hook here but from within
cgraph_node::create_virtual_clone (and perhaps also
cgraph_node::create_version_clone_with_body?), if only now there are two
passes creating clones and there may easily be more in the future.
Thanks,
Martin
> * target.def(sanitize_clone_attributes): New target hook.
> * targhooks.c(default_sanitize_clone_attributes): New.
> * targhooks.h(default_sanitize_clone_attributes): New.
> * doc/tm.texi.in: Document new target hook.
> * doc/tm.texi: Regenerated