summaryrefslogtreecommitdiff
path: root/gcc/cgraphclones.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-27 09:08:20 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-27 09:08:20 +0000
commit131f3644ef87d5406722ee42b0989cb5783156fa (patch)
tree6f9c3016cb1696987ba7b0cc8c1b8c5400c6157d /gcc/cgraphclones.c
parent851ccf1afd9b0e045e7dda2539a3dfa30c16bb64 (diff)
downloadgcc-131f3644ef87d5406722ee42b0989cb5783156fa.tar.gz
2015-05-27 Basile Starynkevitch <basile@starynkevitch.net>
{{merged with almost GCC 5. i.e. trunk r222129 from 2015-04-15, using svn merge -r219880:222129 svn+ssh://bstarynk@gcc.gnu.org/svn/gcc/trunk }} [gcc/] 2015-05-27 Basile Starynkevitch <basile@starynkevitch.net> {{merged with GCC 5, so}} * melt-runtime.h (melt_fatal_error, melt_fatal_error_at_line): Pass UNKNOWN_LOCATION for GCC 5. Re-indented with command: astyle --style=gnu -s2 * melt-runtime.cc: Re-indented with command: astyle --style=gnu -s2 (melt_branch_process_arguments, melt_ggcstart_callback) (melt_reserved_allocation_failure): Use melt_fatal_error instead of fatal_error. * melt/generated/meltrunsup-inc.cc: Manually edited for fatal_error. * melt/generated/warmelt-first.cc: Ditto. * melt/warmelt-first.melt (melt_assert_failure_fun): Ditto. * melt/warmelt-modes.melt (generate_runtypesupport_scanning): Ditto, in the emitted code. * Makefile.in: mention s-gtype instead of gt-melt-runtime.h in dependencies. (TEXI_GCCINT_FILES): Add meltgendoc.texi. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@223739 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraphclones.c')
-rw-r--r--gcc/cgraphclones.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c
index 2a7de2e6689..b587ff2cb76 100644
--- a/gcc/cgraphclones.c
+++ b/gcc/cgraphclones.c
@@ -437,7 +437,7 @@ cgraph_node::expand_all_artificial_thunks ()
node is not inlined. */
cgraph_node *
-cgraph_node::create_clone (tree decl, gcov_type gcov_count, int freq,
+cgraph_node::create_clone (tree new_decl, gcov_type gcov_count, int freq,
bool update_original,
vec<cgraph_edge *> redirect_callers,
bool call_duplication_hook,
@@ -449,7 +449,7 @@ cgraph_node::create_clone (tree decl, gcov_type gcov_count, int freq,
gcov_type count_scale;
unsigned i;
- new_node->decl = decl;
+ new_node->decl = new_decl;
new_node->register_symbol ();
new_node->origin = origin;
new_node->lto_file_data = lto_file_data;
@@ -471,9 +471,12 @@ cgraph_node::create_clone (tree decl, gcov_type gcov_count, int freq,
new_node->frequency = frequency;
new_node->tp_first_run = tp_first_run;
new_node->tm_clone = tm_clone;
+ new_node->icf_merged = icf_merged;
+ new_node->merged = merged;
new_node->clone.tree_map = NULL;
new_node->clone.args_to_skip = args_to_skip;
+ new_node->split_part = split_part;
if (!args_to_skip)
new_node->clone.combined_args_to_skip = clone.combined_args_to_skip;
else if (clone.combined_args_to_skip)
@@ -533,19 +536,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 +561,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.
@@ -577,7 +590,7 @@ cgraph_node::create_virtual_clone (vec<cgraph_edge *> redirect_callers,
char *name;
if (!in_lto_p)
- gcc_checking_assert (tree_versionable_function_p (old_decl));
+ gcc_checking_assert (tree_versionable_function_p (old_decl));
gcc_assert (local.can_change_signature || !args_to_skip);
@@ -617,6 +630,8 @@ cgraph_node::create_virtual_clone (vec<cgraph_edge *> redirect_callers,
ABI support for this. */
set_new_clone_decl_and_node_flags (new_node);
new_node->clone.tree_map = tree_map;
+ if (!implicit_section)
+ new_node->set_section (get_section ());
/* Clones of global symbols or symbols with unique names are unique. */
if ((TREE_PUBLIC (old_decl)
@@ -1009,6 +1024,8 @@ cgraph_node::create_version_clone_with_body
new_version_node->externally_visible = 0;
new_version_node->local.local = 1;
new_version_node->lowered = true;
+ if (!implicit_section)
+ new_version_node->set_section (get_section ());
/* Clones of global symbols or symbols with unique names are unique. */
if ((TREE_PUBLIC (old_decl)
&& !DECL_EXTERNAL (old_decl)