diff options
author | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-02-20 12:55:37 +0000 |
---|---|---|
committer | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-02-20 12:55:37 +0000 |
commit | a73afd90b2aabde5f66c582cdf96c93a6e8d443c (patch) | |
tree | b7f86a4a4bee0677428f7fbe07e9f03c662aebed /gcc/cgraphclones.c | |
parent | a99d800aace5adb4db93393966c51f6f8f729bab (diff) | |
download | gcc-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.c | 22 |
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. |