unsigned int ix_u = streamer_read_uhwi (ib);
tree result = (*file_data->current_decl_state
->streams[LTO_DECL_STREAM])[ix_u];
- gcc_assert (TREE_CODE (result) == VAR_DECL);
+ gcc_assert (VAR_P (result));
return result;
}
if (TYPE_P (t))
{
- gcc_assert (TYPE_CANONICAL (t) == NULL_TREE);
+ gcc_assert (TYPE_STRUCTURAL_EQUALITY_P (t));
if (type_with_alias_set_p (t)
&& canonical_type_used_p (t))
TYPE_CANONICAL (t) = TYPE_MAIN_VARIANT (t);
&& lto_variably_modified_type_p (DECL_CONTEXT (t)))
return false;
else
- return (TYPE_P (t) || DECL_P (t) || TREE_CODE (t) == SSA_NAME);
+ return (IS_TYPE_OR_DECL_P (t) || TREE_CODE (t) == SSA_NAME);
}
lto_output_var_decl_ref (struct lto_out_decl_state *decl_state,
struct lto_output_stream * obs, tree decl)
{
- gcc_checking_assert (TREE_CODE (decl) == VAR_DECL);
+ gcc_checking_assert (VAR_P (decl));
streamer_write_uhwi_stream
(obs, lto_get_index (&decl_state->streams[LTO_DECL_STREAM],
decl));
else if (RECORD_OR_UNION_TYPE_P (expr))
for (tree t = TYPE_FIELDS (expr); t; t = TREE_CHAIN (t))
DFS_follow_tree_edge (t);
- else if (TREE_CODE (expr) == FUNCTION_TYPE
- || TREE_CODE (expr) == METHOD_TYPE)
+ else if (FUNC_OR_METHOD_TYPE_P (expr))
DFS_follow_tree_edge (TYPE_ARG_TYPES (expr));
if (!POINTER_TYPE_P (expr))
{
tree t = *tp;
if (handled_component_p (t)
- && TREE_CODE (TREE_OPERAND (t, 0)) == VAR_DECL
+ && VAR_P (TREE_OPERAND (t, 0))
&& TREE_PUBLIC (TREE_OPERAND (t, 0)))
{
tree decl = TREE_OPERAND (t, 0);
? GCCST_VARIABLE : GCCST_FUNCTION);
lto_write_data (&c, 1);
unsigned char section_kind = 0;
- if (TREE_CODE (t) == VAR_DECL)
+ if (VAR_P (t))
{
section *s = get_variable_section (t, false);
if (s->common.flags & SECTION_BSS)
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))
/* 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;
|| 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)));
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)
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);
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))