]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ipa: Drop the default value of suffix parameter of create_clone (PR119852)
authorMartin Jambor <mjambor@suse.cz>
Tue, 6 May 2025 15:28:44 +0000 (17:28 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Tue, 6 May 2025 15:32:30 +0000 (17:32 +0200)
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.

gcc/cgraph.h
gcc/cgraphclones.cc
gcc/ipa-inline-transform.cc
gcc/ipa-inline.cc
gcc/lto-cgraph.cc

index 1a59bf609b5136f791d204bfcc6e98d9444d43ea..f4ee29e998c37993570423a0addbf36e344c49a8 100644 (file)
@@ -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
index cb457e5f457fe1f34848ee5c6dd10893d09a08b0..b45ac4977331130c304488c348b69d31169589f8 100644 (file)
@@ -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.  */
index e00887be481b0aaf83fe9e3932deb35da4a0adca..46b8e5bb679080f45bd2efdb12aebe62cd9c26d0 100644 (file)
@@ -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);
        }
index 38fdbfde1b3bf4d5da5cd3947e901cedbe3f7a79..35e5496d8463a601f7dd3e0a772d5e2fa8a1ce3d 100644 (file)
@@ -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);
index 8439c51fb2bd62dbc613b881a9b8c75d98436cc9..ec34f659d6a4b30c30e656fca01006a5216044ac 100644 (file)
@@ -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
     {