Hi, I noticed that the name of the fifth parameter of cgraph_node::create_version_clone_with_body is different in the class definition in cgraph.h and in the actual member function definition in cgraphclones.cc. The former (clone_name) is misleading and so this patch changes it to the latter (suffix) which is also used in related functions.
The patch also updates the function comment in both places because it clearly became out of date. Bootstrapped and tested on x86_64-linux. OK for master? Thanks, Martin gcc/ChangeLog: 2025-04-25 Martin Jambor <mjam...@suse.cz> * cgraph.h (cgraph_node::create_version_clone_with_body): Fix function comment. Change the name of clone_name to suffix, in line with the function definition. * cgraphclones.cc (cgraph_node::create_version_clone_with_body): Fix function comment. --- gcc/cgraph.h | 9 +++++---- gcc/cgraphclones.cc | 7 ++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 45119e3dce9..2b374d2f96f 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -1020,11 +1020,12 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node TREE_MAP is a mapping of tree nodes we want to replace with new ones (according to results of prior analysis). - If non-NULL ARGS_TO_SKIP determine function parameters to remove - from new version. - If SKIP_RETURN is true, the new version will return void. + If non-NULL PARAM_ADJUSTMENTS determine how function formal parameters + should be modified in the new version and if it should return void. If non-NULL BLOCK_TO_COPY determine what basic blocks to copy. If non_NULL NEW_ENTRY determine new entry BB of the clone. + SUFFIX is a string that will be used to create a new name for the new + function. If TARGET_ATTRIBUTES is non-null, when creating a new declaration, add the attributes to DECL_ATTRIBUTES. And call valid_attribute_p @@ -1039,7 +1040,7 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, ipa_param_adjustments *param_adjustments, - bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name, + bitmap bbs_to_copy, basic_block new_entry_block, const char *suffix, tree target_attributes = NULL_TREE, bool version_decl = true); /* Insert a new cgraph_function_version_info node into cgraph_fnver_htab diff --git a/gcc/cgraphclones.cc b/gcc/cgraphclones.cc index 3c9c642bdec..761fbdfa000 100644 --- a/gcc/cgraphclones.cc +++ b/gcc/cgraphclones.cc @@ -1002,11 +1002,12 @@ cgraph_node::create_version_clone (tree new_decl, TREE_MAP is a mapping of tree nodes we want to replace with new ones (according to results of prior analysis). - If non-NULL ARGS_TO_SKIP determine function parameters to remove - from new version. - If SKIP_RETURN is true, the new version will return void. + If non-NULL PARAM_ADJUSTMENTS determine how function formal parameters + should be modified in the new version and if it should return void. If non-NULL BLOCK_TO_COPY determine what basic blocks to copy. If non_NULL NEW_ENTRY determine new entry BB of the clone. + SUFFIX is a string that will be used to create a new name for the new + function. If TARGET_ATTRIBUTES is non-null, when creating a new declaration, add the attributes to DECL_ATTRIBUTES. And call valid_attribute_p -- 2.49.0