public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/users/marxin/heads/PR-clone_function_name-refactoring)] cgraph_clone: simplify.
Date: Wed, 18 Aug 2021 11:35:24 +0000 (GMT)	[thread overview]
Message-ID: <20210818113524.3AA78398547B@sourceware.org> (raw)

https://gcc.gnu.org/g:17802cca2d8640fca4f445e88ab5582abd9bfec0

commit 17802cca2d8640fca4f445e88ab5582abd9bfec0
Author: Martin Liska <mliska@suse.cz>
Date:   Wed Aug 18 13:26:15 2021 +0200

    cgraph_clone: simplify.

Diff:
---
 gcc/cgraphclones.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c
index b16e68194e1..d82c2d2eee7 100644
--- a/gcc/cgraphclones.c
+++ b/gcc/cgraphclones.c
@@ -572,9 +572,8 @@ cgraph_node::create_virtual_clone (const vec<cgraph_edge *> &redirect_callers,
   tree old_decl = decl;
   cgraph_node *new_node = NULL;
   tree new_decl;
-  size_t len, i;
+  size_t i;
   ipa_replace_map *map;
-  char *name;
 
   gcc_checking_assert (versionable);
   /* TODO: It would be nice if we could recognize that param_adjustments do not
@@ -599,14 +598,8 @@ cgraph_node::create_virtual_clone (const vec<cgraph_edge *> &redirect_callers,
      sometimes storing only clone decl instead of original.  */
 
   /* Generate a new name for the new version. */
-  len = IDENTIFIER_LENGTH (DECL_NAME (old_decl));
-  name = XALLOCAVEC (char, len + strlen (suffix) + 2);
-  memcpy (name, IDENTIFIER_POINTER (DECL_NAME (old_decl)), len);
-  strcpy (name + len + 1, suffix);
-  name[len] = '.';
-  DECL_NAME (new_decl) = get_identifier (name);
-  SET_DECL_ASSEMBLER_NAME (new_decl,
-			   clone_function_name (old_decl, suffix, num_suffix));
+  DECL_NAME (new_decl) = clone_function_name (old_decl, suffix, num_suffix);
+  SET_DECL_ASSEMBLER_NAME (new_decl, DECL_NAME (new_decl));
   SET_DECL_RTL (new_decl, NULL);
 
   new_node = create_clone (new_decl, count, false,


             reply	other threads:[~2021-08-18 11:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 11:35 Martin Liska [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-08-18 11:26 Martin Liska

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210818113524.3AA78398547B@sourceware.org \
    --to=marxin@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).