summaryrefslogtreecommitdiff
path: root/gcc/cgraphclones.c
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-20 12:55:37 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-20 12:55:37 +0000
commita73afd90b2aabde5f66c582cdf96c93a6e8d443c (patch)
treeb7f86a4a4bee0677428f7fbe07e9f03c662aebed /gcc/cgraphclones.c
parenta99d800aace5adb4db93393966c51f6f8f729bab (diff)
downloadgcc-a73afd90b2aabde5f66c582cdf96c93a6e8d443c.tar.gz
* cgraph.h (clone_function_name_1): Declare.
* cgraphclones.c (clone_function_name_1): New function. (clone_function_name): Use it. * lto-partition.c: Include "stringpool.h". (must_not_rename, maybe_rewrite_identifier, validize_symbol_for_target): New static functions. (privatize_symbol_name): Use must_not_rename. (promote_symbol): Call validize_symbol_for_target. (lto_promote_cross_file_statics): Likewise. (lto_promote_statics_nonwpa): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220855 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraphclones.c')
-rw-r--r--gcc/cgraphclones.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c
index 655b0ab7804..d0a5f707136 100644
--- a/gcc/cgraphclones.c
+++ b/gcc/cgraphclones.c
@@ -533,19 +533,19 @@ cgraph_node::create_clone (tree decl, gcov_type gcov_count, int freq,
return new_node;
}
-/* Return a new assembler name for a clone of DECL with SUFFIX. */
-
static GTY(()) unsigned int clone_fn_id_num;
+/* Return a new assembler name for a clone with SUFFIX of a decl named
+ NAME. */
+
tree
-clone_function_name (tree decl, const char *suffix)
+clone_function_name_1 (const char *name, const char *suffix)
{
- tree name = DECL_ASSEMBLER_NAME (decl);
- size_t len = IDENTIFIER_LENGTH (name);
+ size_t len = strlen (name);
char *tmp_name, *prefix;
prefix = XALLOCAVEC (char, len + strlen (suffix) + 2);
- memcpy (prefix, IDENTIFIER_POINTER (name), len);
+ memcpy (prefix, name, len);
strcpy (prefix + len + 1, suffix);
#ifndef NO_DOT_IN_LABEL
prefix[len] = '.';
@@ -558,6 +558,16 @@ clone_function_name (tree decl, const char *suffix)
return get_identifier (tmp_name);
}
+/* Return a new assembler name for a clone of DECL with SUFFIX. */
+
+tree
+clone_function_name (tree decl, const char *suffix)
+{
+ tree name = DECL_ASSEMBLER_NAME (decl);
+ return clone_function_name_1 (IDENTIFIER_POINTER (name), suffix);
+}
+
+
/* Create callgraph node clone with new declaration. The actual body will
be copied later at compilation stage.