diff options
author | Aaron Sawdey <acsawdey@linux.ibm.com> | 2020-11-17 17:17:44 -0600 |
---|---|---|
committer | Aaron Sawdey <acsawdey@linux.ibm.com> | 2020-11-21 07:37:06 -0600 |
commit | 1e2d8575ace4e12dbe95ae2d4a49a4d89c6f67eb (patch) | |
tree | 56df58c192ba5bedc0e5a16cba6c1ccf1a7365ec /gcc/cp | |
parent | a3454130760bf51b76495663c60ac6dffbe3d130 (diff) | |
download | gcc-1e2d8575ace4e12dbe95ae2d4a49a4d89c6f67eb.zip gcc-1e2d8575ace4e12dbe95ae2d4a49a4d89c6f67eb.tar.gz gcc-1e2d8575ace4e12dbe95ae2d4a49a4d89c6f67eb.tar.bz2 |
Additional small changes to support opaque modes
After building some larger codes using opaque types and some c++ codes
using opaque types it became clear I needed to go through and look for
places where opaque types and modes needed to be handled. A whole pile
of one-liners.
gcc/
* typeclass.h: Add opaque_type_class.
* builtins.c (type_to_class): Identify opaque type class.
* dwarf2out.c (is_base_type): Handle opaque types.
(gen_type_die_with_usage): Handle opaque types.
* expr.c (count_type_elements): Opaque types should
never have initializers.
* ipa-devirt.c (odr_types_equivalent_p): No type-specific handling
for opaque types is needed as it eventually checks the underlying
mode which is what is important.
* tree-streamer.c (record_common_node): Handle opaque types.
* tree.c (type_contains_placeholder_1): Handle opaque types.
(type_cache_hasher::equal): No additional comparison needed for
opaque types.
gcc/c-family
* c-pretty-print.c (c_pretty_printer::simple_type_specifier):
Treat opaque types like other types.
(c_pretty_printer::direct_abstract_declarator): Opaque types are
supported types.
gcc/c
* c-aux-info.c (gen_type): Support opaque types.
gcc/cp
* error.c (dump_type): Handle opaque types.
(dump_type_prefix): Handle opaque types.
(dump_type_suffix): Handle opaque types.
(dump_expr): Handle opaque types.
* pt.c (tsubst): Allow opaque types in templates.
(unify): Allow opaque types in templates.
* typeck.c (structural_comptypes): Handle comparison
of opaque types.
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/error.c | 4 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 396558b..d27545d 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -529,6 +529,7 @@ dump_type (cxx_pretty_printer *pp, tree t, int flags) case INTEGER_TYPE: case REAL_TYPE: case VOID_TYPE: + case OPAQUE_TYPE: case BOOLEAN_TYPE: case COMPLEX_TYPE: case VECTOR_TYPE: @@ -874,6 +875,7 @@ dump_type_prefix (cxx_pretty_printer *pp, tree t, int flags) case UNION_TYPE: case LANG_TYPE: case VOID_TYPE: + case OPAQUE_TYPE: case TYPENAME_TYPE: case COMPLEX_TYPE: case VECTOR_TYPE: @@ -997,6 +999,7 @@ dump_type_suffix (cxx_pretty_printer *pp, tree t, int flags) case UNION_TYPE: case LANG_TYPE: case VOID_TYPE: + case OPAQUE_TYPE: case TYPENAME_TYPE: case COMPLEX_TYPE: case VECTOR_TYPE: @@ -2810,6 +2813,7 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags) case ENUMERAL_TYPE: case REAL_TYPE: case VOID_TYPE: + case OPAQUE_TYPE: case BOOLEAN_TYPE: case INTEGER_TYPE: case COMPLEX_TYPE: diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 463b1c3..b037786 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -15376,6 +15376,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) case ERROR_MARK: case IDENTIFIER_NODE: case VOID_TYPE: + case OPAQUE_TYPE: case REAL_TYPE: case COMPLEX_TYPE: case VECTOR_TYPE: @@ -23588,6 +23589,7 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict, case BOOLEAN_TYPE: case ENUMERAL_TYPE: case VOID_TYPE: + case OPAQUE_TYPE: case NULLPTR_TYPE: if (TREE_CODE (arg) != TREE_CODE (parm)) return unify_type_mismatch (explain_p, parm, arg); diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 700e166..729c706 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -1314,6 +1314,7 @@ structural_comptypes (tree t1, tree t2, int strict) /* All void and bool types are the same. */ break; + case OPAQUE_TYPE: case INTEGER_TYPE: case FIXED_POINT_TYPE: case REAL_TYPE: |