]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Reorganize mangle_builtin_type.[NFC]
authorJu-Zhe Zhong <juzhe.zhong@rivai.ai>
Fri, 14 Oct 2022 23:02:36 +0000 (07:02 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Mon, 17 Oct 2022 08:04:15 +0000 (16:04 +0800)
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.

gcc/config/riscv/riscv-vector-builtins.cc

index 99c482582d3f5904efeb54e5a3691290d3d95680..55d456516185170a59d4cbf203bfcab55f22b4af 100644 (file)
@@ -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