diff options
author | Andrew Haley <aph@redhat.com> | 2000-11-15 14:39:14 +0000 |
---|---|---|
committer | Andrew Haley <aph@gcc.gnu.org> | 2000-11-15 14:39:14 +0000 |
commit | 12e1243e426a12358e793cef2735e77c37452ec7 (patch) | |
tree | 125e489e2c90a52e691eac99b293650f052b66f7 /gcc/tree.c | |
parent | 71631a1f1ce6cba9b823cb48a2bff17e97e2664f (diff) | |
download | gcc-12e1243e426a12358e793cef2735e77c37452ec7.zip gcc-12e1243e426a12358e793cef2735e77c37452ec7.tar.gz gcc-12e1243e426a12358e793cef2735e77c37452ec7.tar.bz2 |
tree.c (build_type_no_quals): New function.
2000-11-13 Andrew Haley <aph@redhat.com>
* tree.c (build_type_no_quals): New function.
* tree.h (build_type_no_quals): Declare.
* c-common.c (c_get_alias_set): When considering type
compatibility for pointer types, ignore cv-qualifiers anywhere in
a pointer chain.
From-SVN: r37479
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -3798,6 +3798,26 @@ build_reference_type (to_type) return t; } +/* Build a type that is compatible with t but has no cv quals anywhere + in its type, thus + + const char *const *const * -> char ***. */ + +tree +build_type_no_quals (t) + tree t; +{ + switch (TREE_CODE (t)) + { + case POINTER_TYPE: + return build_pointer_type (build_type_no_quals (TREE_TYPE (t))); + case REFERENCE_TYPE: + return build_reference_type (build_type_no_quals (TREE_TYPE (t))); + default: + return TYPE_MAIN_VARIANT (t); + } +} + /* Create a type of integers to be the TYPE_DOMAIN of an ARRAY_TYPE. MAXVAL should be the maximum value in the domain (one less than the length of the array). |