public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/PR-clone_function_name-refactoring)] cgraph_clone: simplify.
@ 2021-08-18 11:26 Martin Liska
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Liska @ 2021-08-18 11:26 UTC (permalink / raw)
  To: gcc-cvs

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,


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gcc(refs/users/marxin/heads/PR-clone_function_name-refactoring)] cgraph_clone: simplify.
@ 2021-08-18 11:35 Martin Liska
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Liska @ 2021-08-18 11:35 UTC (permalink / raw)
  To: gcc-cvs

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,


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-18 11:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-18 11:26 [gcc(refs/users/marxin/heads/PR-clone_function_name-refactoring)] cgraph_clone: simplify Martin Liska
2021-08-18 11:35 Martin Liska

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).