From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id 3AA78398547B; Wed, 18 Aug 2021 11:35:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3AA78398547B Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/marxin/heads/PR-clone_function_name-refactoring)] cgraph_clone: simplify. X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/users/marxin/heads/PR-clone_function_name-refactoring X-Git-Oldrev: 76bb3c50dd43a5f87d4f949cf0d0979144562e6c X-Git-Newrev: 17802cca2d8640fca4f445e88ab5582abd9bfec0 Message-Id: <20210818113524.3AA78398547B@sourceware.org> Date: Wed, 18 Aug 2021 11:35:24 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 11:35:24 -0000 https://gcc.gnu.org/g:17802cca2d8640fca4f445e88ab5582abd9bfec0 commit 17802cca2d8640fca4f445e88ab5582abd9bfec0 Author: Martin Liska 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 &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 &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,