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:26:41 +0000 (GMT)	[thread overview]
Message-ID: <20210818112641.4CB62388A826@sourceware.org> (raw)

https://gcc.gnu.org/g:a62acbcefdfbca28f043eb6ce70e428bf708509f

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

    cgraph_clone: simplify.

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

diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c
index b16e68194e1..f6f20ebd6ef 100644
--- a/gcc/cgraphclones.c
+++ b/gcc/cgraphclones.c
@@ -599,14 +599,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:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 11:26 Martin Liska [this message]
2021-08-18 11:35 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=20210818112641.4CB62388A826@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).