diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2017-06-23 11:05:47 +0200 |
---|---|---|
committer | Marc Glisse <glisse@gcc.gnu.org> | 2017-06-23 09:05:47 +0000 |
commit | 2db9b7cd422b63fe0a87218128cc0939b439859e (patch) | |
tree | 8874bb67d61acd34ac953c902f78942ea9e4d604 /gcc/lto/lto-lang.c | |
parent | 70fdc808941016567f8e55caea593324b15df230 (diff) | |
download | gcc-2db9b7cd422b63fe0a87218128cc0939b439859e.zip gcc-2db9b7cd422b63fe0a87218128cc0939b439859e.tar.gz gcc-2db9b7cd422b63fe0a87218128cc0939b439859e.tar.bz2 |
Refactor fileptr_type_node handling
2017-06-23 Marc Glisse <marc.glisse@inria.fr>
gcc/
* tree.h (builtin_structptr_type): New type.
(builtin_structptr_types): Declare new array.
* tree.c (builtin_structptr_types): New array.
(free_lang_data, build_common_tree_nodes): Use it.
gcc/c-family/
* c-common.c (c_common_nodes_and_builtins): Use builtin_structptr_types.
gcc/cp/
* decl.c (duplicate_decls): Use builtin_structptr_types.
gcc/lto/
* lto-lang.c (lto_init): Use builtin_structptr_types.
From-SVN: r249585
Diffstat (limited to 'gcc/lto/lto-lang.c')
-rw-r--r-- | gcc/lto/lto-lang.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c index 52ab2a8..5893517 100644 --- a/gcc/lto/lto-lang.c +++ b/gcc/lto/lto-lang.c @@ -1220,13 +1220,17 @@ lto_init (void) /* In the C++ front-end, fileptr_type_node is defined as a variant copy of ptr_type_node, rather than ptr_node itself. The distinction should only be relevant to the front-end, so we - always use the C definition here in lto1. */ - gcc_assert (fileptr_type_node == ptr_type_node); - gcc_assert (TYPE_MAIN_VARIANT (fileptr_type_node) == ptr_type_node); - /* Likewise for const struct tm*. */ - gcc_assert (const_tm_ptr_type_node == const_ptr_type_node); - gcc_assert (TYPE_MAIN_VARIANT (const_tm_ptr_type_node) - == const_ptr_type_node); + always use the C definition here in lto1. + Likewise for const struct tm*. */ + for (unsigned i = 0; + i < sizeof (builtin_structptr_types) / sizeof (builtin_structptr_type); + ++i) + { + gcc_assert (builtin_structptr_types[i].node + == builtin_structptr_types[i].base); + gcc_assert (TYPE_MAIN_VARIANT (builtin_structptr_types[i].node) + == builtin_structptr_types[i].base); + } lto_build_c_type_nodes (); gcc_assert (va_list_type_node); |