* builtin.c (get_pointer_alignment): Use DECL_P and TYPE_P macros.
* c-common.c (decl_attributes,check_format_info,truthvalue_conversion,
c_get_alias_set): Likewise.
* c-decl.c (duplicate_decls): Likewise.
* c-typeck.c (default_conversion,build_unary_op): Likewise.
* calls.c (initialize_argument_information): Likewise.
* dwarf2out.c (decl_class_context,add_abstract_origin_attribute):
Likewise.
* dwarfout.c (decl_class_context,output_type): Likewise.
* expr.c (get_inner_reference): Likewise.
* fold-const.c (simple_operand_p,fold): Likewise.
* function.c (aggregate_value_p): Likewise.
* stmt.c (expand_asm_operands): Likewise.
* varasm.c (named_section): Likewise.
* call.c (check_dtor_name,build_new_method_call): Likewise.
* decl.c (push_class_binding,poplevel,pushtag,lookup_namespace_name,
make_typename_type,check_initializer,cp_finish_decl,xref_tag): Likewise.
* decl2.c (grokfield,build_expr_from_tree,build_expr_from_tree,
decl_namespace,arg_assoc_template_arg,arg_assoc,
validate_nonmember_using_decl,do_class_using_decl): Likewise.
* error.c (dump_template_argument,dump_expr,cp_file_of,cp_line_of,
args_to_string): Likewise.
* friend.c (is_friend): Likewise.
* lex.c (note_got_semicolon,note_list_got_semicolon,is_global): Likewise.
* method.c (build_overload_nested_name,build_overload_value,
build_qualified_name,build_qualified_name,hack_identifier): Likewise.
* parse.y (typename_sub,typename_sub1): Likewise.
* pt.c (push_inline_template_parms_recursive,check_template_shadow,
process_partial_specialization,convert_template_argument,
template_args_equal,add_pending_template,lookup_template_class,
for_each_template_parm_r,maybe_fold_nontype_arg,
tsubst,instantiate_template,type_unification_real,unify,
instantiate_pending_templates,set_mangled_name_for_template_decl):
Likewise.
* repo.c (repo_get_id,repo_template_used): Likewise.
* search.c (lookup_field_1): Likewise.
* tree.c (walk_tree,get_type_decl,cp_tree_equal,member_p): Likewise.
* xref.c (classname): Likewise.
From-SVN: r32698
+2000-03-22 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
+
+ * builtin.c (get_pointer_alignment): Use DECL_P and TYPE_P macros.
+ * c-common.c (decl_attributes,check_format_info,truthvalue_conversion,
+ c_get_alias_set): Likewise.
+ * c-decl.c (duplicate_decls): Likewise.
+ * c-typeck.c (default_conversion,build_unary_op): Likewise.
+ * calls.c (initialize_argument_information): Likewise.
+ * dwarf2out.c (decl_class_context,add_abstract_origin_attribute):
+ Likewise.
+ * dwarfout.c (decl_class_context,output_type): Likewise.
+ * expr.c (get_inner_reference): Likewise.
+ * fold-const.c (simple_operand_p,fold): Likewise.
+ * function.c (aggregate_value_p): Likewise.
+ * stmt.c (expand_asm_operands): Likewise.
+ * varasm.c (named_section): Likewise.
+
2000-03-22 Jason Merrill <jason@casey.cygnus.com>
Implement dwarf2 exception handling for the ARM.
exp = TREE_OPERAND (exp, 0);
if (TREE_CODE (exp) == FUNCTION_DECL)
align = FUNCTION_BOUNDARY;
- else if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'd')
+ else if (DECL_P (exp))
align = DECL_ALIGN (exp);
#ifdef CONSTANT_ALIGNMENT
else if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'c')
if (attrtab_idx == 0)
init_attributes ();
- if (TREE_CODE_CLASS (TREE_CODE (node)) == 'd')
+ if (DECL_P (node))
{
decl = node;
type = TREE_TYPE (decl);
is_type = TREE_CODE (node) == TYPE_DECL;
}
- else if (TREE_CODE_CLASS (TREE_CODE (node)) == 't')
+ else if (TYPE_P (node))
type = node, is_type = 1;
#ifdef PRAGMA_INSERT_ATTRIBUTES
&& (TYPE_READONLY (cur_type)
|| (cur_param != 0
&& (TREE_CODE_CLASS (TREE_CODE (cur_param)) == 'c'
- || (TREE_CODE_CLASS (TREE_CODE (cur_param)) == 'd'
- && TREE_READONLY (cur_param))))))
+ || (DECL_P (cur_param) && TREE_READONLY (cur_param))))))
warning ("writing into constant object (arg %d)", arg_num);
/* Check the type of the "real" argument, if there's a type we want. */
case ADDR_EXPR:
/* If we are taking the address of a external decl, it might be zero
if it is weak, so we cannot optimize. */
- if (TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND (expr, 0))) == 'd'
+ if (DECL_P (TREE_OPERAND (expr, 0))
&& DECL_EXTERNAL (TREE_OPERAND (expr, 0)))
break;
if (t == error_mark_node)
return 0;
- type = (TREE_CODE_CLASS (TREE_CODE (t)) == 't')
- ? t : TREE_TYPE (t);
+ type = (TYPE_P (t)) ? t : TREE_TYPE (t);
if (type == error_mark_node)
return 0;
tree newtype = TREE_TYPE (newdecl);
int errmsg = 0;
- if (TREE_CODE_CLASS (TREE_CODE (olddecl)) == 'd')
+ if (DECL_P (olddecl))
DECL_MACHINE_ATTRIBUTES (newdecl)
= merge_machine_decl_attributes (olddecl, newdecl);
int constp = 0;
int volatilep = 0;
- if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'r'
- || TREE_CODE_CLASS (TREE_CODE (exp)) == 'd')
+ if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'r' || DECL_P (exp))
{
constp = TREE_READONLY (exp);
volatilep = TREE_THIS_VOLATILE (exp);
to which the address will point. Note that you can't get a
restricted pointer by taking the address of something, so we
only have to deal with `const' and `volatile' here. */
- if (TREE_CODE_CLASS (TREE_CODE (arg)) == 'd'
- || TREE_CODE_CLASS (TREE_CODE (arg)) == 'r')
+ if (DECL_P (arg) || TREE_CODE_CLASS (TREE_CODE (arg)) == 'r')
{
if (TREE_READONLY (arg) || TREE_THIS_VOLATILE (arg))
argtype = c_build_type_variant (argtype,
make a bitwise copy of the argument. */
if (TREE_CODE (args[i].tree_value) == TARGET_EXPR
- && (TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND
- (args[i].tree_value, 1)))
- == 'd')
+ && (DECL_P (TREE_OPERAND (args[i].tree_value, 1)))
&& ! REG_P (DECL_RTL (TREE_OPERAND (args[i].tree_value, 1))))
args[i].tree_value = TREE_OPERAND (args[i].tree_value, 1);
+2000-03-20 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
+
+ * call.c (check_dtor_name,build_new_method_call): Likewise.
+ * decl.c (push_class_binding,poplevel,pushtag,lookup_namespace_name,
+ make_typename_type,check_initializer,cp_finish_decl,xref_tag): Likewise.
+ * decl2.c (grokfield,build_expr_from_tree,build_expr_from_tree,
+ decl_namespace,arg_assoc_template_arg,arg_assoc,
+ validate_nonmember_using_decl,do_class_using_decl): Likewise.
+ * error.c (dump_template_argument,dump_expr,cp_file_of,cp_line_of,
+ args_to_string): Likewise.
+ * friend.c (is_friend): Likewise.
+ * lex.c (note_got_semicolon,note_list_got_semicolon,is_global): Likewise.
+ * method.c (build_overload_nested_name,build_overload_value,
+ build_qualified_name,build_qualified_name,hack_identifier): Likewise.
+ * parse.y (typename_sub,typename_sub1): Likewise.
+ * pt.c (push_inline_template_parms_recursive,check_template_shadow,
+ process_partial_specialization,convert_template_argument,
+ template_args_equal,add_pending_template,lookup_template_class,
+ for_each_template_parm_r,maybe_fold_nontype_arg,
+ tsubst,instantiate_template,type_unification_real,unify,
+ instantiate_pending_templates,set_mangled_name_for_template_decl):
+ Likewise.
+ * repo.c (repo_get_id,repo_template_used): Likewise.
+ * search.c (lookup_field_1): Likewise.
+ * tree.c (walk_tree,get_type_decl,cp_tree_equal,member_p): Likewise.
+ * xref.c (classname): Likewise.
+
2000-03-22 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (BINFO_FOR_VBASE): Adjust documentation.
if (TREE_CODE (name) == TYPE_DECL)
name = TREE_TYPE (name);
- else if (TREE_CODE_CLASS (TREE_CODE (name)) == 't')
+ else if (TYPE_P (name))
/* OK */;
else if (TREE_CODE (name) == IDENTIFIER_NODE)
{
{
explicit_targs = TREE_OPERAND (name, 1);
name = TREE_OPERAND (name, 0);
- if (TREE_CODE_CLASS (TREE_CODE (name)) == 'd')
+ if (DECL_P (name))
name = DECL_NAME (name);
else
{
context = CP_DECL_CONTEXT (OVL_CURRENT (decl));
else
{
- my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (decl)) == 'd',
- 0);
+ my_friendly_assert (DECL_P (decl), 0);
context = CP_DECL_CONTEXT (decl);
}
decl = link;
if (TREE_CODE (decl) == TREE_LIST)
decl = TREE_VALUE (decl);
- if (TREE_CODE_CLASS (TREE_CODE (decl)) == 'd')
+ if (DECL_P (decl))
pop_binding (DECL_NAME (decl), decl);
else if (TREE_CODE (decl) == OVERLOAD)
pop_binding (DECL_NAME (OVL_FUNCTION (decl)), decl);
if (! globalize)
context = cs;
- else if (cs != NULL_TREE
- && TREE_CODE_CLASS (TREE_CODE (cs)) == 't')
+ else if (cs != NULL_TREE && TYPE_P (cs))
/* When declaring a friend class of a local class, we want
to inject the newly named class into the scope
containing the local class, not the namespace scope. */
name = TREE_OPERAND (name, 0);
if (TREE_CODE (name) == OVERLOAD)
name = DECL_NAME (OVL_CURRENT (name));
- else if (TREE_CODE_CLASS (TREE_CODE (name)) == 'd')
+ else if (DECL_P (name))
name = DECL_NAME (name);
}
{
tree fullname;
- if (TREE_CODE_CLASS (TREE_CODE (name)) == 't')
+ if (TYPE_P (name))
{
if (!(TYPE_LANG_SPECIFIC (name)
&& (CLASSTYPE_IS_TEMPLATE (name)
}
else if (DECL_EXTERNAL (decl))
;
- else if (TREE_CODE_CLASS (TREE_CODE (type)) == 't'
+ else if (TYPE_P (type)
&& (IS_AGGR_TYPE (type) || TYPE_NEEDS_CONSTRUCTING (type)))
{
tree core_type = strip_array_types (type);
if (type == error_mark_node)
return;
-
+
/* Add this declaration to the statement-tree. */
if (building_stmt_tree () && at_function_scope_p ())
add_decl_stmt (decl);
{
tree context = CP_DECL_CONTEXT (decl);
if (context
- && TREE_CODE_CLASS (TREE_CODE (context)) == 't'
+ && TYPE_P (context)
&& (TREE_CODE (decl) == VAR_DECL
/* We also have a pushclass done that we need to undo here
if we're at top level and declare a method. */
/* If a cross reference is requested, look up the type
already defined for this tag and return it. */
- if (TREE_CODE_CLASS (TREE_CODE (name)) == 't')
+ if (TYPE_P (name))
{
t = name;
name = TYPE_IDENTIFIER (t);
static, since references are initialized with the address. */
if (TREE_CODE (TREE_TYPE (value)) != REFERENCE_TYPE
|| (TREE_STATIC (init) == 0
- && (TREE_CODE_CLASS (TREE_CODE (init)) != 'd'
- || DECL_EXTERNAL (init) == 0)))
+ && (!DECL_P (init) || DECL_EXTERNAL (init) == 0)))
{
error ("field initializer is not constant");
init = error_mark_node;
case ALIGNOF_EXPR:
{
tree r = build_expr_from_tree (TREE_OPERAND (t, 0));
- if (TREE_CODE_CLASS (TREE_CODE (r)) != 't')
+ if (!TYPE_P (r))
r = TREE_TYPE (r);
return TREE_CODE (t) == SIZEOF_EXPR ? c_sizeof (r) : c_alignof (r);
}
}
case TYPEID_EXPR:
- if (TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND (t, 0))) == 't')
+ if (TYPE_P (TREE_OPERAND (t, 0)))
return get_typeid (TREE_OPERAND (t, 0));
return build_typeid (build_expr_from_tree (TREE_OPERAND (t, 0)));
decl = DECL_CONTEXT (decl);
if (TREE_CODE (decl) == NAMESPACE_DECL)
return decl;
- if (TREE_CODE_CLASS (TREE_CODE (decl)) == 't')
+ if (TYPE_P (decl))
decl = TYPE_STUB_DECL (decl);
- my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (decl)) == 'd', 390);
+ my_friendly_assert (DECL_P (decl), 390);
}
return global_namespace;
}
/* It's not a template template argument, but it is a type template
argument. */
- else if (TREE_CODE_CLASS (TREE_CODE (arg)) == 't')
+ else if (TYPE_P (arg))
return arg_assoc_type (k, arg);
/* It's a non-type template argument. */
else
if (n == error_mark_node)
return 0;
- if (TREE_CODE_CLASS (TREE_CODE (n)) == 't')
+ if (TYPE_P (n))
return arg_assoc_type (k, n);
if (! type_unknown_p (n))
}
else
my_friendly_abort (382);
- if (TREE_CODE_CLASS (TREE_CODE (*name)) == 'd')
+ if (DECL_P (*name))
*name = DECL_NAME (*name);
/* Make a USING_DECL. */
return push_using_decl (*scope, *name);
tree name, value;
if (TREE_CODE (decl) != SCOPE_REF
- || TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND (decl, 0))) != 't')
+ || !TYPE_P (TREE_OPERAND (decl, 0)))
{
cp_error ("using-declaration for non-member at class scope");
return NULL_TREE;
tree arg;
enum tree_string_flags flags;
{
- if (TREE_CODE_CLASS (TREE_CODE (arg)) == 't'
- || TREE_CODE (arg) == TEMPLATE_DECL)
+ if (TYPE_P (arg) || TREE_CODE (arg) == TEMPLATE_DECL)
dump_type (arg, flags & ~TS_AGGR_TAGS);
else
dump_expr (arg, (flags | TS_EXPR_PARENS) & ~TS_AGGR_TAGS);
my_friendly_assert (TREE_CODE (t) == ALIGNOF_EXPR, 0);
OB_PUTS ("__alignof__ (");
}
- if (TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND (t, 0))) == 't')
+ if (TYPE_P (TREE_OPERAND (t, 0)))
dump_type (TREE_OPERAND (t, 0), flags);
else
dump_unary_op ("*", t, flags | TS_EXPR_PARENS);
{
if (TREE_CODE (t) == PARM_DECL && DECL_CONTEXT (t))
return DECL_SOURCE_FILE (DECL_CONTEXT (t));
- else if (TREE_CODE_CLASS (TREE_CODE (t)) == 't')
+ else if (TYPE_P (t))
return DECL_SOURCE_FILE (TYPE_MAIN_DECL (t));
else if (TREE_CODE (t) == OVERLOAD)
return DECL_SOURCE_FILE (OVL_FUNCTION (t));
&& TYPE_MAIN_DECL (TREE_TYPE (t)))
t = TREE_TYPE (t);
- if (TREE_CODE_CLASS (TREE_CODE (t)) == 't')
+ if (TYPE_P (t))
line = DECL_SOURCE_LINE (TYPE_MAIN_DECL (t));
else if (TREE_CODE (t) == OVERLOAD)
line = DECL_SOURCE_LINE (OVL_FUNCTION (t));
if (p == NULL_TREE)
return "";
- if (TREE_CODE_CLASS (TREE_CODE (TREE_VALUE (p))) == 't')
+ if (TYPE_P (TREE_VALUE (p)))
return type_as_string (p, flags);
OB_INIT ();
if (supplicant == NULL_TREE || type == NULL_TREE)
return 0;
- declp = (TREE_CODE_CLASS (TREE_CODE (supplicant)) == 'd');
+ declp = DECL_P (supplicant);
if (declp)
/* It's a function decl. */
note_got_semicolon (type)
tree type;
{
- if (TREE_CODE_CLASS (TREE_CODE (type)) != 't')
+ if (!TYPE_P (type))
my_friendly_abort (60);
if (CLASS_TYPE_P (type))
CLASSTYPE_GOT_SEMICOLON (type) = 1;
for (link = declspecs; link; link = TREE_CHAIN (link))
{
tree type = TREE_VALUE (link);
- if (TREE_CODE_CLASS (TREE_CODE (type)) == 't')
+ if (TYPE_P (type))
note_got_semicolon (type);
}
clear_anon_tags ();
case OVERLOAD: d = OVL_FUNCTION (d); continue;
case TREE_LIST: d = TREE_VALUE (d); continue;
default:
- my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (d)) == 'd', 980629);
+ my_friendly_assert (DECL_P (d), 980629);
return DECL_NAMESPACE_SCOPE_P (d);
}
build_mangled_name_for_type (context);
else
{
- if (TREE_CODE_CLASS (TREE_CODE (context)) == 't')
+ if (TYPE_P (context))
context = TYPE_NAME (context);
build_overload_nested_name (context);
}
tree type, value;
mangling_flags flags;
{
- my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (type)) == 't', 0);
+ my_friendly_assert (TYPE_P (type), 0);
while (TREE_CODE (value) == NON_LVALUE_EXPR
|| TREE_CODE (value) == NOP_EXPR)
tree context;
int i = 1;
- if (TREE_CODE_CLASS (TREE_CODE (decl)) == 't')
+ if (TYPE_P (decl))
decl = TYPE_NAME (decl);
/* If DECL_ASSEMBLER_NAME has been set properly, use it. */
if (check_ktype (context, FALSE) != -1)
/* Found one! */
break;
- if (TREE_CODE_CLASS (TREE_CODE (context)) == 't')
+ if (TYPE_P (context))
context = TYPE_NAME (context);
}
}
}
}
- if (TREE_CODE_CLASS (TREE_CODE (value)) == 'd' && DECL_NONLOCAL (value))
+ if (DECL_P (value) && DECL_NONLOCAL (value))
{
if (DECL_CLASS_SCOPE_P (value)
&& DECL_CONTEXT (value) != current_class_type)
case 645:
#line 2947 "parse.y"
{
- if (TREE_CODE_CLASS (TREE_CODE (yyvsp[-1].ttype)) == 't')
+ if (TYPE_P (yyvsp[-1].ttype))
yyval.ttype = make_typename_type (yyvsp[-1].ttype, yyvsp[0].ttype, /*complain=*/1);
else if (TREE_CODE (yyvsp[0].ttype) == IDENTIFIER_NODE)
cp_error ("`%T' is not a class or namespace", yyvsp[0].ttype);
case 650:
#line 2974 "parse.y"
{
- if (TREE_CODE_CLASS (TREE_CODE (yyvsp[-1].ttype)) == 't')
+ if (TYPE_P (yyvsp[-1].ttype))
yyval.ttype = make_typename_type (yyvsp[-1].ttype, yyvsp[0].ttype, /*complain=*/1);
else if (TREE_CODE (yyvsp[0].ttype) == IDENTIFIER_NODE)
cp_error ("`%T' is not a class or namespace", yyvsp[0].ttype);
typename_sub0:
typename_sub1 identifier %prec EMPTY
{
- if (TREE_CODE_CLASS (TREE_CODE ($1)) == 't')
+ if (TYPE_P ($1))
$$ = make_typename_type ($1, $2, /*complain=*/1);
else if (TREE_CODE ($2) == IDENTIFIER_NODE)
cp_error ("`%T' is not a class or namespace", $2);
}
| typename_sub1 typename_sub2
{
- if (TREE_CODE_CLASS (TREE_CODE ($1)) == 't')
+ if (TYPE_P ($1))
$$ = make_typename_type ($1, $2, /*complain=*/1);
else if (TREE_CODE ($2) == IDENTIFIER_NODE)
cp_error ("`%T' is not a class or namespace", $2);
for (i = 0; i < TREE_VEC_LENGTH (parms); ++i)
{
tree parm = TREE_VALUE (TREE_VEC_ELT (parms, i));
- my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (parm)) == 'd', 0);
+ my_friendly_assert (DECL_P (parm), 0);
switch (TREE_CODE (parm))
{
that OLDDECL might be an OVERLOAD (or perhaps even an
ERROR_MARK), so we can't just blithely assume it to be a _DECL
node. */
- if (TREE_CODE_CLASS (TREE_CODE (olddecl)) != 'd'
- || !DECL_TEMPLATE_PARM_P (olddecl))
+ if (!DECL_P (olddecl) || !DECL_TEMPLATE_PARM_P (olddecl))
return;
/* We check for decl != olddecl to avoid bogus errors for using a
{
tree arg = TREE_VEC_ELT (inner_args, i);
if (/* These first two lines are the `non-type' bit. */
- TREE_CODE_CLASS (TREE_CODE (arg)) != 't'
+ !TYPE_P (arg)
&& TREE_CODE (arg) != TEMPLATE_DECL
/* This next line is the `argument expression is not just a
simple identifier' condition and also the `specialized
else if (is_tmpl_type && TREE_CODE (arg) == RECORD_TYPE)
arg = CLASSTYPE_TI_TEMPLATE (arg);
- is_type = TREE_CODE_CLASS (TREE_CODE (arg)) == 't' || is_tmpl_type;
+ is_type = TYPE_P (arg) || is_tmpl_type;
if (requires_type && ! is_type && TREE_CODE (arg) == SCOPE_REF
&& TREE_CODE (TREE_OPERAND (arg, 0)) == TEMPLATE_TYPE_PARM)
if (TREE_CODE (nt) == TREE_VEC)
/* For member templates */
return comp_template_args (ot, nt);
- else if (TREE_CODE_CLASS (TREE_CODE (ot)) == 't')
+ else if (TYPE_P (ot))
return same_type_p (ot, nt);
else
return (cp_tree_equal (ot, nt) > 0);
add_pending_template (d)
tree d;
{
- tree ti;
-
- if (TREE_CODE_CLASS (TREE_CODE (d)) == 't')
- ti = CLASSTYPE_TEMPLATE_INFO (d);
- else
- ti = DECL_TEMPLATE_INFO (d);
+ tree ti = (TYPE_P (d)) ? CLASSTYPE_TEMPLATE_INFO (d) : DECL_TEMPLATE_INFO (d);
if (TI_PENDING_TEMPLATE_FLAG (ti))
return;
}
}
else if (TREE_CODE (d1) == ENUMERAL_TYPE
- || (TREE_CODE_CLASS (TREE_CODE (d1)) == 't'
- && IS_AGGR_TYPE (d1)))
+ || (TYPE_P (d1) && IS_AGGR_TYPE (d1)))
{
template = TYPE_TI_TEMPLATE (d1);
d1 = DECL_NAME (template);
scopes. */
for (ctx = current_class_type;
ctx;
- ctx = (TREE_CODE_CLASS (TREE_CODE (ctx)) == 't')
- ? TYPE_CONTEXT (ctx) : DECL_CONTEXT (ctx))
+ ctx = (TYPE_P (ctx)) ? TYPE_CONTEXT (ctx) : DECL_CONTEXT (ctx))
if (same_type_p (ctx, template_type))
break;
tree_fn_t fn = pfd->fn;
void *data = pfd->data;
- if (TREE_CODE_CLASS (TREE_CODE (t)) == 't'
+ if (TYPE_P (t)
&& for_each_template_parm (TYPE_CONTEXT (t), fn, data))
return error_mark_node;
if (! processing_template_decl)
return arg;
- if (TREE_CODE_CLASS (TREE_CODE (arg)) != 't'
- && !uses_template_parms (arg))
+ if (!TYPE_P (arg) && !uses_template_parms (arg))
{
/* Sometimes, one of the args was an expression involving a
template constant parameter, like N - 1. Now that we've
if (type == error_mark_node)
return error_mark_node;
- if (TREE_CODE_CLASS (TREE_CODE (t)) == 'd')
+ if (DECL_P (t))
return tsubst_decl (t, args, type, in_decl);
switch (TREE_CODE (t))
{
if (TREE_CODE (t) == TEMPLATE_TYPE_PARM)
{
- my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (arg))
- == 't', 0);
+ my_friendly_assert (TYPE_P (arg), 0);
return cp_build_qualified_type_real
(arg, CP_TYPE_QUALS (arg) | CP_TYPE_QUALS (t),
complain);
while (i--)
{
tree t = TREE_VEC_ELT (inner_args, i);
- if (TREE_CODE_CLASS (TREE_CODE (t)) == 't')
+ if (TYPE_P (t))
{
tree nt = target_type (t);
if (IS_AGGR_TYPE (nt) && decl_function_context (TYPE_MAIN_DECL (nt)))
{
tree type;
- if (TREE_CODE_CLASS (TREE_CODE (arg)) != 't')
+ if (!TYPE_P (arg))
type = TREE_TYPE (arg);
else
{
return 1;
}
- if (TREE_CODE_CLASS (TREE_CODE (arg)) != 't')
+ if (!TYPE_P (arg))
{
my_friendly_assert (TREE_TYPE (arg) != NULL_TREE, 293);
if (type_unknown_p (arg))
/* Immediately reject some pairs that won't unify because of
cv-qualification mismatches. */
if (TREE_CODE (arg) == TREE_CODE (parm)
- && TREE_CODE_CLASS (TREE_CODE (arg)) == 't'
+ && TYPE_P (arg)
/* We check the cv-qualifiers when unifying with template type
parameters below. We want to allow ARG `const T' to unify with
PARM `T' for example, when computing which of two templates
input_filename = SRCLOC_FILE (srcloc);
lineno = SRCLOC_LINE (srcloc);
- if (TREE_CODE_CLASS (TREE_CODE (instantiation)) == 't')
+ if (TYPE_P (instantiation))
{
tree fn;
mangled name. Unfortunately, build_decl_overload_real does not
get the decl to mangle, so it relies on the current
namespace. Therefore, we set that here temporarily. */
- my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (decl)) == 'd', 980702);
+ my_friendly_assert (DECL_P (decl), 980702);
saved_namespace = current_namespace;
current_namespace = CP_DECL_CONTEXT (decl);
repo_get_id (t)
tree t;
{
- if (TREE_CODE_CLASS (TREE_CODE (t)) == 't')
+ if (TYPE_P (t))
{
/* If we're not done setting up the class, we may not have set up
the vtable, so going ahead would give the wrong answer.
if (id == NULL_TREE)
return;
- if (TREE_CODE_CLASS (TREE_CODE (t)) == 't')
+ if (TYPE_P (t))
{
if (IDENTIFIER_REPO_CHOSEN (id))
mark_class_instantiated (t, 0);
}
- else if (TREE_CODE_CLASS (TREE_CODE (t)) == 'd')
+ else if (DECL_P (t))
{
if (IDENTIFIER_REPO_CHOSEN (id))
mark_decl_instantiated (t, 0);
#ifdef GATHER_STATISTICS
n_fields_searched++;
#endif /* GATHER_STATISTICS */
- my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (field)) == 'd', 0);
+ my_friendly_assert (DECL_P (field), 0);
if (DECL_NAME (field) == NULL_TREE
&& ANON_AGGR_TYPE_P (TREE_TYPE (field)))
{
{
if (code == DECL_STMT
&& DECL_STMT_DECL (*tp)
- && TREE_CODE_CLASS (TREE_CODE (DECL_STMT_DECL (*tp))) == 'd')
+ && DECL_P (DECL_STMT_DECL (*tp)))
{
/* Walk the DECL_INITIAL and DECL_SIZE. We don't want to walk
into declarations that are just mentioned, rather than
{
if (TREE_CODE (t) == TYPE_DECL)
return t;
- if (TREE_CODE_CLASS (TREE_CODE (t)) == 't')
+ if (TYPE_P (t))
return TYPE_STUB_DECL (t);
my_friendly_abort (42);
case ALIGNOF_EXPR:
if (TREE_CODE (TREE_OPERAND (t1, 0)) != TREE_CODE (TREE_OPERAND (t2, 0)))
return 0;
- if (TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND (t1, 0))) == 't')
+ if (TYPE_P (TREE_OPERAND (t1, 0)))
return same_type_p (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
break;
member_p (decl)
tree decl;
{
- tree ctx = DECL_CONTEXT (decl);
- return (ctx && TREE_CODE_CLASS (TREE_CODE (ctx)) == 't');
+ const tree ctx = DECL_CONTEXT (decl);
+ return (ctx && TYPE_P (ctx));
}
/* Create a placeholder for member access where we don't actually have an
classname (cls)
tree cls;
{
- if (cls && TREE_CODE_CLASS (TREE_CODE (cls)) == 't')
+ if (cls && TYPE_P (cls))
cls = TYPE_NAME (cls);
- if (cls && TREE_CODE_CLASS (TREE_CODE (cls)) == 'd')
+ if (cls && DECL_P (cls))
cls = DECL_NAME (cls);
if (cls && TREE_CODE (cls) == IDENTIFIER_NODE)
return IDENTIFIER_POINTER (cls);
context = TYPE_MAIN_VARIANT
(TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl)))));
- if (context && TREE_CODE_CLASS (TREE_CODE (context)) != 't')
+ if (context && !TYPE_P (context))
context = NULL_TREE;
return context;
gen_abstract_function (fn);
}
- if (TREE_CODE_CLASS (TREE_CODE (origin)) == 'd')
+ if (DECL_P (origin))
origin_die = lookup_decl_die (origin);
- else if (TREE_CODE_CLASS (TREE_CODE (origin)) == 't')
+ else if (TYPE_P (origin))
origin_die = lookup_type_die (origin);
if (origin_die == NULL)
context = TYPE_MAIN_VARIANT
(TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl)))));
- if (context && TREE_CODE_CLASS (TREE_CODE (context)) != 't')
+ if (context && !TYPE_P (context))
context = NULL_TREE;
return context;
written out yet, writing it out will cover this one, too. */
if (TYPE_CONTEXT (type)
- && TREE_CODE_CLASS (TREE_CODE (TYPE_CONTEXT (type))) == 't'
+ && TYPE_P (TYPE_CONTEXT (type))
&& ! TREE_ASM_WRITTEN (TYPE_CONTEXT (type)))
{
output_type (TYPE_CONTEXT (type), containing_scope);
exp = TREE_OPERAND (exp, 0);
}
- if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'd')
+ if (DECL_P (exp))
alignment = MIN (alignment, DECL_ALIGN (exp));
else if (TREE_TYPE (exp) != 0)
alignment = MIN (alignment, TYPE_ALIGN (TREE_TYPE (exp)));
exp = TREE_OPERAND (exp, 0);
return (TREE_CODE_CLASS (TREE_CODE (exp)) == 'c'
- || (TREE_CODE_CLASS (TREE_CODE (exp)) == 'd'
+ || (DECL_P (exp)
&& ! TREE_ADDRESSABLE (exp)
&& ! TREE_THIS_VOLATILE (exp)
&& ! DECL_NONLOCAL (exp)
/* If the second operand is simpler than the third, swap them
since that produces better jump optimization results. */
- if ((TREE_CONSTANT (arg1) || TREE_CODE_CLASS (TREE_CODE (arg1)) == 'd'
+ if ((TREE_CONSTANT (arg1) || DECL_P (arg1)
|| TREE_CODE (arg1) == SAVE_EXPR)
&& ! (TREE_CONSTANT (TREE_OPERAND (t, 2))
- || TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND (t, 2))) == 'd'
+ || DECL_P (TREE_OPERAND (t, 2))
|| TREE_CODE (TREE_OPERAND (t, 2)) == SAVE_EXPR))
{
/* See if this can be inverted. If it can't, possibly because
{
int i, regno, nregs;
rtx reg;
- tree type;
- if (TREE_CODE_CLASS (TREE_CODE (exp)) == 't')
- type = exp;
- else
- type = TREE_TYPE (exp);
+
+ tree type = (TYPE_P (exp)) ? exp : TREE_TYPE (exp);
if (RETURN_IN_MEMORY (type))
return 1;
real_output_rtx[i] = NULL_RTX;
if ((TREE_CODE (val) == INDIRECT_REF
&& allows_mem)
- || (TREE_CODE_CLASS (TREE_CODE (val)) == 'd'
+ || (DECL_P (val)
&& (allows_mem || GET_CODE (DECL_RTL (val)) == REG)
&& ! (GET_CODE (DECL_RTL (val)) == REG
&& GET_MODE (DECL_RTL (val)) != TYPE_MODE (type)))
default:
/* Referencing a volatile value is a side effect, so don't warn. */
- if ((TREE_CODE_CLASS (TREE_CODE (exp)) == 'd'
+ if ((DECL_P (exp)
|| TREE_CODE_CLASS (TREE_CODE (exp)) == 'r')
&& TREE_THIS_VOLATILE (exp))
return 0;
const char *name;
int reloc ATTRIBUTE_UNUSED;
{
- if (decl != NULL_TREE
- && TREE_CODE_CLASS (TREE_CODE (decl)) != 'd')
+ if (decl != NULL_TREE && !DECL_P (decl))
abort ();
if (name == NULL)
name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
tree decl ATTRIBUTE_UNUSED;
{
#ifdef ASM_OUTPUT_EXTERNAL
- if (TREE_CODE_CLASS (TREE_CODE (decl)) == 'd'
- && DECL_EXTERNAL (decl) && TREE_PUBLIC (decl))
+ if (DECL_P (decl) && DECL_EXTERNAL (decl) && TREE_PUBLIC (decl))
{
rtx rtl = DECL_RTL (decl);