aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTejas Belagod <tejas.belagod@arm.com>2024-10-13 15:50:23 +0530
committerTejas Belagod <tejas.belagod@arm.com>2025-04-08 11:50:49 +0530
commit7058b2d0c9d2240c4b30c97cfa4cae33e2d845cc (patch)
treed9c1b28bf4869bff440d528732bc7855408c7dc4 /gcc
parent001fb23ae46ba4bd1b5e43f756fa89e6fb94ce18 (diff)
downloadgcc-7058b2d0c9d2240c4b30c97cfa4cae33e2d845cc.zip
gcc-7058b2d0c9d2240c4b30c97cfa4cae33e2d845cc.tar.gz
gcc-7058b2d0c9d2240c4b30c97cfa4cae33e2d845cc.tar.bz2
Add function to strip pointer type and get down to the actual pointee type.
Add a function to traverse down the pointer layers to the pointee type. gcc/ChangeLog: * tree.h (strip_pointer_types): New.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 55f97f9..99f2617 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -5053,6 +5053,17 @@ strip_array_types (tree type)
return type;
}
+/* Recursively traverse down pointer type layers to pointee 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 {