diff options
author | Bernhard Reutner-Fischer <aldot@gcc.gnu.org> | 2023-05-14 00:48:07 +0200 |
---|---|---|
committer | Bernhard Reutner-Fischer <aldot@gcc.gnu.org> | 2023-05-18 21:49:52 +0200 |
commit | f6a4d079419ce7b2cd13f579e1be702864a395cc (patch) | |
tree | c0d8277b226860efd0afcff698ad0d918c7b93c8 /gcc/lto | |
parent | 8621e06ae8dc938875bdb090c9c3c9ec751cf499 (diff) | |
download | gcc-f6a4d079419ce7b2cd13f579e1be702864a395cc.zip gcc-f6a4d079419ce7b2cd13f579e1be702864a395cc.tar.gz gcc-f6a4d079419ce7b2cd13f579e1be702864a395cc.tar.bz2 |
lto: use _P() defines from tree.h
gcc/ChangeLog:
* lto-streamer-in.cc (lto_input_var_decl_ref): Use _P defines from
tree.h.
(lto_read_body_or_constructor): Ditto.
* lto-streamer-out.cc (tree_is_indexable): Ditto.
(lto_output_var_decl_ref): Ditto.
(DFS::DFS_write_tree_body): Ditto.
(wrap_refs): Ditto.
(write_symbol_extension_info): Ditto.
gcc/lto/ChangeLog:
* lto-common.cc (lto_maybe_register_decl): Use _P defines from tree.h.
* lto-symtab.cc (warn_type_compatibility_p): Ditto.
(lto_symtab_resolve_replaceable_p): Ditto.
(lto_symtab_merge_decls_1): Ditto.
* lto-symtab.h (lto_symtab_prevailing_decl): Ditto.
Diffstat (limited to 'gcc/lto')
-rw-r--r-- | gcc/lto/lto-common.cc | 2 | ||||
-rw-r--r-- | gcc/lto/lto-symtab.cc | 8 | ||||
-rw-r--r-- | gcc/lto/lto-symtab.h | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/gcc/lto/lto-common.cc b/gcc/lto/lto-common.cc index 882dd89..5375702 100644 --- a/gcc/lto/lto-common.cc +++ b/gcc/lto/lto-common.cc @@ -958,7 +958,7 @@ lto_register_function_decl_in_symtab (class data_in *data_in, tree decl, static void lto_maybe_register_decl (class data_in *data_in, tree t, unsigned ix) { - if (TREE_CODE (t) == VAR_DECL) + if (VAR_P (t)) lto_register_var_decl_in_symtab (data_in, t, ix); else if (TREE_CODE (t) == FUNCTION_DECL && !fndecl_built_in_p (t)) diff --git a/gcc/lto/lto-symtab.cc b/gcc/lto/lto-symtab.cc index 2b57d0d..79ba8dd 100644 --- a/gcc/lto/lto-symtab.cc +++ b/gcc/lto/lto-symtab.cc @@ -214,7 +214,7 @@ warn_type_compatibility_p (tree prevailing_type, tree type, /* Function types needs special care, because types_compatible_p never thinks prototype is compatible to non-prototype. */ - if (TREE_CODE (type) == FUNCTION_TYPE || TREE_CODE (type) == METHOD_TYPE) + if (FUNC_OR_METHOD_TYPE_P (type)) { if (TREE_CODE (type) != TREE_CODE (prevailing_type)) lev |= 1; @@ -401,7 +401,7 @@ lto_symtab_resolve_replaceable_p (symtab_node *e) || DECL_WEAK (e->decl)) return true; - if (TREE_CODE (e->decl) == VAR_DECL) + if (VAR_P (e->decl)) return (DECL_COMMON (e->decl) || (!flag_no_common && !DECL_INITIAL (e->decl))); @@ -803,7 +803,7 @@ lto_symtab_merge_decls_1 (symtab_node *first) This is needed for C++ typeinfos, for example in lto/20081204-1 there are typeifos in both units, just one of them do have size. */ - if (TREE_CODE (prevailing->decl) == VAR_DECL) + if (VAR_P (prevailing->decl)) { for (e = prevailing->next_sharing_asm_name; e; e = e->next_sharing_asm_name) @@ -848,7 +848,7 @@ lto_symtab_merge_decls_1 (symtab_node *first) break; case FUNCTION_DECL: - gcc_assert (TREE_CODE (e->decl) == VAR_DECL); + gcc_assert (VAR_P (e->decl)); error_at (DECL_SOURCE_LOCATION (e->decl), "function %qD redeclared as variable", prevailing->decl); diff --git a/gcc/lto/lto-symtab.h b/gcc/lto/lto-symtab.h index f654f2c..a60f262 100644 --- a/gcc/lto/lto-symtab.h +++ b/gcc/lto/lto-symtab.h @@ -46,7 +46,7 @@ lto_symtab_prevailing_decl (tree decl) return DECL_CHAIN (decl); else { - if ((TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == FUNCTION_DECL) + if ((VAR_P (decl) || TREE_CODE (decl) == FUNCTION_DECL) && DECL_VIRTUAL_P (decl) && (TREE_PUBLIC (decl) || DECL_EXTERNAL (decl)) && !symtab_node::get (decl)) |