diff mbox series

[v2,03/12,tree] Add function to strip pointer type and get down to the actual pointee type.

Message ID 20241018062233.243950-4-tejas.belagod@arm.com
State New
Headers show
Series AArch64/OpenMP: Test SVE ACLE types with various OpenMP constructs. | expand

Commit Message

Tejas Belagod Oct. 18, 2024, 6:22 a.m. UTC
Add a function to traverse down the pointer layers to the pointee type.

gcc/ChangeLog:
	* tree.h (strip_pointer_types): New.
---
 gcc/tree.h | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/gcc/tree.h b/gcc/tree.h
index 75efc760a16..e2b4dd36444 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -4992,6 +4992,15 @@  strip_array_types (tree type)
   return type;
 }
 
+inline const_tree
+strip_pointer_types (const_tree type)
+{
+  while (POINTER_TYPE_P (type))
+    type = TREE_TYPE (type);
+
+  return type;
+}
+
 /* Desription of the reason why the argument of valid_constant_size_p
    is not a valid size.  */
 enum cst_size_error {