aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 743293e..8b04c37 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -10825,4 +10825,21 @@ get_binfo_at_offset (tree binfo, HOST_WIDE_INT offset, tree expected_type)
return binfo;
}
+/* Returns true if X is a typedef decl. */
+
+bool
+is_typedef_decl (tree x)
+{
+ return (x && TREE_CODE (x) == TYPE_DECL
+ && DECL_ORIGINAL_TYPE (x) != NULL_TREE);
+}
+
+/* Returns true iff TYPE is a type variant created for a typedef. */
+
+bool
+typedef_variant_p (tree type)
+{
+ return is_typedef_decl (TYPE_NAME (type));
+}
+
#include "gt-tree.h"