public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Carlotti <andrew.carlotti@arm.com>
To: gcc-patches@gcc.gnu.org
Cc: Richard Biener <richard.guenther@gmail.com>
Subject: [PATCH 3/5] Change create_version_clone_with_body parameter name
Date: Mon, 15 Jan 2024 11:27:38 +0000	[thread overview]
Message-ID: <10e06fe9-513c-e0b9-eb95-b240d7abc53a@e124511.cambridge.arm.com> (raw)
In-Reply-To: <db8b5080-2f2f-64c9-456e-c8553b16d677@e124511.cambridge.arm.com>

The new name better describes where it is used, and will be more
suitable when subsequent commits make further changes to this function.

gcc/ChangeLog:

	* cgraph.h (create_version_clone_with_body): Rename parameter
	and change default value.
	* cgraphclones.cc: Rename parameter.
	* multiple_target.cc (create_target_clone): Update for inverted
	boolean parameter.


diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index b4f028b3f3034056de1050ea1ab93a682197d0e1..16e2b2d045767206d5ccf12ee226f92ee10511d9 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -1015,8 +1015,8 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node
      that will promote value of the attribute DECL_FUNCTION_SPECIFIC_TARGET
      of the declaration.
 
-     If VERSION_DECL is set true, use clone_function_name_numbered for the
-     function clone.  Otherwise, use clone_function_name.
+     If TARGET_VERSION is set true, use clone_function_name to set new names.
+     Otherwise, use clone_function_name_numbered.
 
      Return the new version's cgraph node.  */
   cgraph_node *create_version_clone_with_body
@@ -1024,7 +1024,7 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node
      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,
-     tree target_attributes = NULL_TREE, bool version_decl = true);
+     tree target_attributes = NULL_TREE, bool target_version = false);
 
   /* Insert a new cgraph_function_version_info node into cgraph_fnver_htab
      corresponding to cgraph_node.  */
diff --git a/gcc/cgraphclones.cc b/gcc/cgraphclones.cc
index 6d7bc402a29161f473aaa34fb11b24264a7e8b7c..ab9a0fe7ccc5fcf9a0a03363c66016466d39427e 100644
--- a/gcc/cgraphclones.cc
+++ b/gcc/cgraphclones.cc
@@ -1013,7 +1013,7 @@ cgraph_node::create_version_clone_with_body
    vec<ipa_replace_map *, va_gc> *tree_map,
    ipa_param_adjustments *param_adjustments,
    bitmap bbs_to_copy, basic_block new_entry_block, const char *suffix,
-   tree target_attributes, bool version_decl)
+   tree target_attributes, bool target_version)
 {
   tree old_decl = decl;
   cgraph_node *new_version_node = NULL;
@@ -1034,8 +1034,8 @@ cgraph_node::create_version_clone_with_body
     new_decl = copy_node (old_decl);
 
   /* Generate a new name for the new version. */
-  tree fnname = (version_decl ? clone_function_name_numbered (old_decl, suffix)
-		: clone_function_name (old_decl, suffix));
+  tree fnname = (target_version ? clone_function_name (old_decl, suffix)
+		: clone_function_name_numbered (old_decl, suffix));
   DECL_NAME (new_decl) = fnname;
   SET_DECL_ASSEMBLER_NAME (new_decl, fnname);
   SET_DECL_RTL (new_decl, NULL);
diff --git a/gcc/multiple_target.cc b/gcc/multiple_target.cc
index 56a1934fe820e91b2fa451dcf6989382c906b98c..5fa13ee78035924e5dbd2aec1dd05192342c1a59 100644
--- a/gcc/multiple_target.cc
+++ b/gcc/multiple_target.cc
@@ -281,7 +281,7 @@ create_target_clone (cgraph_node *node, bool definition, char *name,
     {
       new_node
 	= node->create_version_clone_with_body (vNULL, NULL, NULL, NULL, NULL,
-						name, attributes, false);
+						name, attributes, true);
       if (new_node == NULL)
 	return NULL;
       new_node->force_output = true;

  parent reply	other threads:[~2024-01-15 11:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-15 11:26 [PATCH 0/5] Fix fmv mangling for AArch64 Andrew Carlotti
2024-01-15 11:26 ` [PATCH 1/5] testsuite: Add tests for fmv symbol presence and mangling Andrew Carlotti
2024-01-15 11:27 ` [PATCH 2/5] tree: Extend DECL_FUNCTION_VERSIONED to an enum Andrew Carlotti
2024-01-15 12:28   ` Richard Biener
2024-01-16  8:21     ` Andrew Carlotti
2024-01-16 10:42       ` [PATCH] aarch64: Fix function multiversioning mangling Andrew Carlotti
2024-01-25 16:49         ` Richard Sandiford
2024-01-15 11:27 ` Andrew Carlotti [this message]
2024-01-15 11:28 ` [PATCH 4/5] cp: Use get_mangled_id in more places in mangle_decl Andrew Carlotti
2024-01-16 20:24   ` Jason Merrill
2024-01-15 11:28 ` [PATCH 5/5] Add target hook for function version name mangling Andrew Carlotti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10e06fe9-513c-e0b9-eb95-b240d7abc53a@e124511.cambridge.arm.com \
    --to=andrew.carlotti@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).