diff options
Diffstat (limited to 'gcc/c/c-objc-common.c')
-rw-r--r-- | gcc/c/c-objc-common.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/c/c-objc-common.c b/gcc/c/c-objc-common.c index 21ca7e6..2b76737 100644 --- a/gcc/c/c-objc-common.c +++ b/gcc/c/c-objc-common.c @@ -265,3 +265,22 @@ c_vla_unspec_p (tree x, tree fn ATTRIBUTE_UNUSED) { return c_vla_type_p (x); } + +/* Special routine to get the alias set of T for C. */ + +alias_set_type +c_get_alias_set (tree t) +{ + /* Allow aliasing between enumeral types and the underlying + integer type. This is required since those are compatible types. */ + if (TREE_CODE (t) == ENUMERAL_TYPE) + { + tree t1 = c_common_type_for_size (tree_to_uhwi (TYPE_SIZE (t)), + /* short-cut commoning to signed + type. */ + false); + return get_alias_set (t1); + } + + return c_common_get_alias_set (t); +} |