public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-3323] RISC-V: Reorganize mangle_builtin_type.[NFC]
@ 2022-10-17  8:04 Kito Cheng
  0 siblings, 0 replies; only message in thread
From: Kito Cheng @ 2022-10-17  8:04 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:0ea578e98bebca08bcc8201c7709087f7ef15e1f

commit r13-3323-g0ea578e98bebca08bcc8201c7709087f7ef15e1f
Author: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Date:   Sat Oct 15 07:02:36 2022 +0800

    RISC-V: Reorganize mangle_builtin_type.[NFC]
    
    Hi, this patch fixed my mistake in the previous commit patch.
    Since "mangle_builtin_type" is a global function will be called in riscv.cc.
    It's reasonable move it down and put them together stay with other global functions.
    
    gcc/ChangeLog:
    
            * config/riscv/riscv-vector-builtins.cc (mangle_builtin_type): Move down the function.

Diff:
---
 gcc/config/riscv/riscv-vector-builtins.cc | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/gcc/config/riscv/riscv-vector-builtins.cc b/gcc/config/riscv/riscv-vector-builtins.cc
index 99c482582d3..55d45651618 100644
--- a/gcc/config/riscv/riscv-vector-builtins.cc
+++ b/gcc/config/riscv/riscv-vector-builtins.cc
@@ -155,19 +155,6 @@ lookup_vector_type_attribute (const_tree type)
   return lookup_attribute ("RVV type", TYPE_ATTRIBUTES (type));
 }
 
-/* If TYPE is a built-in type defined by the RVV ABI, return the mangled name,
-   otherwise return NULL.  */
-const char *
-mangle_builtin_type (const_tree type)
-{
-  if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL)
-    type = TREE_TYPE (TYPE_NAME (type));
-  if (tree attr = lookup_vector_type_attribute (type))
-    if (tree id = TREE_VALUE (chain_index (0, TREE_VALUE (attr))))
-      return IDENTIFIER_POINTER (id);
-  return NULL;
-}
-
 /* Return a representation of "const T *".  */
 static tree
 build_const_pointer (tree t)
@@ -250,6 +237,19 @@ register_vector_type (vector_type_index type)
   builtin_types[type].vector_ptr = build_pointer_type (vectype);
 }
 
+/* If TYPE is a built-in type defined by the RVV ABI, return the mangled name,
+   otherwise return NULL.  */
+const char *
+mangle_builtin_type (const_tree type)
+{
+  if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL)
+    type = TREE_TYPE (TYPE_NAME (type));
+  if (tree attr = lookup_vector_type_attribute (type))
+    if (tree id = TREE_VALUE (chain_index (0, TREE_VALUE (attr))))
+      return IDENTIFIER_POINTER (id);
+  return NULL;
+}
+
 /* Initialize all compiler built-ins related to RVV that should be
    defined at start-up.  */
 void

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-17  8:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-17  8:04 [gcc r13-3323] RISC-V: Reorganize mangle_builtin_type.[NFC] Kito Cheng

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).