diff options
author | Martin Jambor <mjambor@suse.cz> | 2025-05-06 17:28:44 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2025-05-06 17:32:30 +0200 |
commit | 76c882e341cb330a4e9f677a8c3541d573820255 (patch) | |
tree | 2bcc10e667bd78276e36a4ef16e45bddcfb2f801 | |
parent | 1eaee43dc0c6292ce865b460d52474ca14ea1d71 (diff) | |
download | gcc-76c882e341cb330a4e9f677a8c3541d573820255.zip gcc-76c882e341cb330a4e9f677a8c3541d573820255.tar.gz gcc-76c882e341cb330a4e9f677a8c3541d573820255.tar.bz2 |
ipa: Drop the default value of suffix parameter of create_clone (PR119852)
In PR 119852 we agreed that since the NULL-ness of the suffix
parameter should prevent creation of a record in the ipa-clones
dump (which is implemented by a previous patch), it should not default
to NULL.
gcc/ChangeLog:
2025-04-25 Martin Jambor <mjambor@suse.cz>
PR ipa/119852
* cgraph.h (cgraph_node::create_clone): Remove the default value of
argument suffix. Update function comment.
* cgraphclones.cc (cgraph_node::create_clone): Update function comment.
* ipa-inline-transform.cc (clone_inlined_nodes): Pass NULL to suffix
of create_clone explicitely.
* ipa-inline.cc (recursive_inlining): Likewise.
* lto-cgraph.cc (input_node): Likewise.
-rw-r--r-- | gcc/cgraph.h | 10 | ||||
-rw-r--r-- | gcc/cgraphclones.cc | 7 | ||||
-rw-r--r-- | gcc/ipa-inline-transform.cc | 2 | ||||
-rw-r--r-- | gcc/ipa-inline.cc | 2 | ||||
-rw-r--r-- | gcc/lto-cgraph.cc | 2 |
5 files changed, 16 insertions, 7 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 1a59bf6..f4ee29e 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -965,15 +965,19 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node If the new node is being inlined into another one, NEW_INLINED_TO should be the outline function the new one is (even indirectly) inlined to. All hooks will see this in node's inlined_to, when invoked. - Can be NULL if the node is not inlined. SUFFIX is string that is appended - to the original name. */ + Should be NULL if the node is not inlined. + + SUFFIX is string that is appended to the original name, it should only be + NULL if NEW_INLINED_TO is not NULL or if the clone being created is + temporary and a record about it should not be added into the ipa-clones + dump file. */ cgraph_node *create_clone (tree decl, profile_count count, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, cgraph_node *new_inlined_to, ipa_param_adjustments *param_adjustments, - const char *suffix = NULL); + const char *suffix); /* Create callgraph node clone with new declaration. The actual body will be copied later at compilation stage. The name of the new clone will be diff --git a/gcc/cgraphclones.cc b/gcc/cgraphclones.cc index cb457e5..b45ac49 100644 --- a/gcc/cgraphclones.cc +++ b/gcc/cgraphclones.cc @@ -366,9 +366,14 @@ localize_profile (cgraph_node *n) If the new node is being inlined into another one, NEW_INLINED_TO should be the outline function the new one is (even indirectly) inlined to. All hooks - will see this in node's inlined_to, when invoked. Can be NULL if the + will see this in node's inlined_to, when invoked. Should be NULL if the node is not inlined. + SUFFIX is string that is appended to the original name, it should only be + NULL if NEW_INLINED_TO is not NULL or if the clone being created is + temporary and a record about it should not be added into the ipa-clones dump + file. + If PARAM_ADJUSTMENTS is non-NULL, the parameter manipulation information will be overwritten by the new structure. Otherwise the new node will share parameter manipulation information with the original node. */ diff --git a/gcc/ipa-inline-transform.cc b/gcc/ipa-inline-transform.cc index e00887b..46b8e5b 100644 --- a/gcc/ipa-inline-transform.cc +++ b/gcc/ipa-inline-transform.cc @@ -225,7 +225,7 @@ clone_inlined_nodes (struct cgraph_edge *e, bool duplicate, e->count, update_original, vNULL, true, inlining_into, - NULL); + NULL, NULL); n->used_as_abstract_origin = e->callee->used_as_abstract_origin; e->redirect_callee (n); } diff --git a/gcc/ipa-inline.cc b/gcc/ipa-inline.cc index 38fdbfd..35e5496 100644 --- a/gcc/ipa-inline.cc +++ b/gcc/ipa-inline.cc @@ -1865,7 +1865,7 @@ recursive_inlining (struct cgraph_edge *edge, { /* We need original clone to copy around. */ master_clone = node->create_clone (node->decl, node->count, - false, vNULL, true, NULL, NULL); + false, vNULL, true, NULL, NULL, NULL); for (e = master_clone->callees; e; e = e->next_callee) if (!e->inline_failed) clone_inlined_nodes (e, true, false, NULL); diff --git a/gcc/lto-cgraph.cc b/gcc/lto-cgraph.cc index 8439c51..ec34f65 100644 --- a/gcc/lto-cgraph.cc +++ b/gcc/lto-cgraph.cc @@ -1303,7 +1303,7 @@ input_node (struct lto_file_decl_data *file_data, { node = dyn_cast<cgraph_node *> (nodes[clone_ref])->create_clone (fn_decl, profile_count::uninitialized (), false, - vNULL, false, NULL, NULL); + vNULL, false, NULL, NULL, NULL); } else { |