From 3efc4e1d96a382ed00f7e529d1f5a5a844c7fa69 Mon Sep 17 00:00:00 2001
From: Michael Ploujnikov <michael.ploujnikov@oracle.com>
Date: Mon, 13 Aug 2018 13:59:46 -0400
Subject: [PATCH 4/4] Use ACONCAT in cgraph_node::create_virtual_clone.
gcc:
2018-10-23 Michael Ploujnikov <michael.ploujnikov@oracle.com>
* cgraphclones.c (cgraph_node::create_virtual_clone): Use
ACONCAT for the DECL_NAME.
---
gcc/cgraphclones.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
@@ -585,9 +585,8 @@ cgraph_node::create_virtual_clone (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 (local.versionable);
gcc_assert (local.can_change_signature || !args_to_skip);
@@ -609,11 +608,8 @@ cgraph_node::create_virtual_clone (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] = '.';
+ char *name = ACONCAT ((IDENTIFIER_POINTER (DECL_NAME (old_decl)),
+ ".", suffix, (char *)0));
DECL_NAME (new_decl) = get_identifier (name);
SET_DECL_ASSEMBLER_NAME (new_decl,
numbered_clone_function_name (old_decl, suffix));
--
2.7.4