Adding Jakub to CC'

On 09/10/2019 16:29, Andre Vieira (lists) wrote:
Hi Martin,

I see thank you. For my particular use case I only need to strip attributes for local symbols.  However, if I were to claim it is only used for non-externally visible clones than I would also need to make sure they are non-externally visible now and put something in place that checks this in the future.  I feel it's easier and more flexible to leave it up to the users of the hook to check it themselves using DECL_EXTERNAL.  I will mention it in the description though.

Cheers,
Andre

gcc/ChangeLog:

2019-10-09  Andre Vieira  <andre.simoesdiasvie...@arm.com>

     * cgraphclones.c(create_clone): Call new target hook when
         creating a new node.
         (create_version_clone): Likewise.
         (create_version_clone_with_body): Likewise.
         * 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

On 09/10/2019 12:43, Martin Jambor wrote:
Hi,

On Wed, Oct 09 2019, Andre Vieira (lists) wrote:
Hi Martin,

Thanks for the suggestion.  I have moved the target hook to the
following functions:
'create_clone'
'create_version_clone'

I am not sure that calling the hook in create_version_clone is what you
want.  It should perhaps be made clearer in the API but unlike
(functions that call) create_clone and create_version_clone_with_body,
the result is not a local symbol but it may also be an externally
visible "version" of the original.  OpenMP uses it to create nodes for
external declarations (not definitions!) of variants of functions marked
with omp declare simd and the function calling it in trans-mem.c also
apparently uses it to create possibly externally visible clones.

Reply via email to