if (type != error_mark_node
&& TREE_CODE (type) == ARRAY_TYPE
&& !DECL_EXTERNAL (decl)
- && TYPE_DOMAIN (type) == 0)
+ && TYPE_DOMAIN (type) == NULL_TREE)
{
warning_at (DECL_SOURCE_LOCATION (decl),
0, "array %q+D assumed to have one element", decl);
/* If appropriate, create a BLOCK to record the decls for the life
of this function. */
- block = 0;
+ block = NULL_TREE;
if (keep)
{
block = make_node (BLOCK);
for (p = scope->blocks; p; p = BLOCK_CHAIN (p))
BLOCK_SUPERCONTEXT (p) = block;
- BLOCK_VARS (block) = 0;
+ BLOCK_VARS (block) = NULL_TREE;
}
/* The TYPE_CONTEXTs for all of the tagged types belonging to this
/* Propagate TREE_ADDRESSABLE from nested functions to their
containing functions. */
if (!TREE_ASM_WRITTEN (p)
- && DECL_INITIAL (p) != 0
+ && DECL_INITIAL (p) != NULL_TREE
&& TREE_ADDRESSABLE (p)
- && DECL_ABSTRACT_ORIGIN (p) != 0
+ && DECL_ABSTRACT_ORIGIN (p) != NULL_TREE
&& DECL_ABSTRACT_ORIGIN (p) != p)
TREE_ADDRESSABLE (DECL_ABSTRACT_ORIGIN (p)) = 1;
if (!DECL_EXTERNAL (p)
if (TREE_CODE (olddecl) != FUNCTION_DECL
|| !comptypes (TREE_TYPE (oldtype), TREE_TYPE (newtype))
- || !((!prototype_p (oldtype) && DECL_INITIAL (olddecl) == 0)
- || (!prototype_p (newtype) && DECL_INITIAL (newdecl) == 0)))
+ || !((!prototype_p (oldtype) && DECL_INITIAL (olddecl) == NULL_TREE)
+ || (!prototype_p (newtype) && DECL_INITIAL (newdecl) == NULL_TREE)))
return;
t = TYPE_ARG_TYPES (oldtype);
- if (t == 0)
+ if (t == NULL_TREE)
t = TYPE_ARG_TYPES (newtype);
for (; t; t = TREE_CHAIN (t))
{
tree type = TREE_VALUE (t);
- if (TREE_CHAIN (t) == 0
+ if (TREE_CHAIN (t) == NULL_TREE
&& TYPE_MAIN_VARIANT (type) != void_type_node)
{
inform (input_location, "a parameter list with an ellipsis can%'t match "
merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
{
bool new_is_definition = (TREE_CODE (newdecl) == FUNCTION_DECL
- && DECL_INITIAL (newdecl) != 0);
+ && DECL_INITIAL (newdecl) != NULL_TREE);
bool new_is_prototype = (TREE_CODE (newdecl) == FUNCTION_DECL
&& prototype_p (TREE_TYPE (newdecl)));
bool old_is_prototype = (TREE_CODE (olddecl) == FUNCTION_DECL
&& DECL_IN_SYSTEM_HEADER (newdecl)
&& !DECL_IN_SYSTEM_HEADER (olddecl))
DECL_SOURCE_LOCATION (olddecl) = DECL_SOURCE_LOCATION (newdecl);
- else if ((DECL_INITIAL (newdecl) == 0 && DECL_INITIAL (olddecl) != 0)
+ else if ((DECL_INITIAL (newdecl) == NULL_TREE
+ && DECL_INITIAL (olddecl) != NULL_TREE)
|| (old_is_prototype && !new_is_prototype
&& !C_DECL_BUILTIN_PROTOTYPE (olddecl)))
DECL_SOURCE_LOCATION (newdecl) = DECL_SOURCE_LOCATION (olddecl);
/* Merge the initialization information. */
- if (DECL_INITIAL (newdecl) == 0)
+ if (DECL_INITIAL (newdecl) == NULL_TREE)
DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl);
/* Merge the threadprivate attribute. */
if (DECL_EXTERNAL (x) || scope == file_scope)
{
tree type = TREE_TYPE (x);
- tree vistype = 0;
- tree visdecl = 0;
+ tree vistype = NULL_TREE;
+ tree visdecl = NULL_TREE;
bool type_saved = false;
if (b && !B_IN_EXTERNAL_SCOPE (b)
&& VAR_OR_FUNCTION_DECL_P (b->decl)
implicitly_declare (location_t loc, tree functionid)
{
struct c_binding *b;
- tree decl = 0;
+ tree decl = NULL_TREE;
tree asmspec_tree;
for (b = I_SYMBOL_BINDING (functionid); b; b = b->shadowed)
static bool already = false;
struct c_scope *scope;
- if (current_function_decl == 0)
+ if (current_function_decl == NULL_TREE)
{
const char *guessed_id = lookup_name_fuzzy (id, FUZZY_LOOKUP_NAME);
if (guessed_id)
if (label
&& ((DECL_CONTEXT (label) == current_function_decl
- && DECL_INITIAL (label) != 0)
+ && DECL_INITIAL (label) != NULL_TREE)
|| (DECL_CONTEXT (label) != current_function_decl
&& C_DECLARED_LABEL_FLAG (label))))
{
void
pending_xref_error (void)
{
- if (pending_invalid_xref != 0)
+ if (pending_invalid_xref != NULL_TREE)
error_at (pending_invalid_xref_location, "%qE defined as wrong kind of tag",
pending_invalid_xref);
- pending_invalid_xref = 0;
+ pending_invalid_xref = NULL_TREE;
}
\f
/* Initialize reserved words for parser. */
c_parse_init ();
- current_function_decl = 0;
+ current_function_decl = NULL_TREE;
gcc_obstack_init (&parser_obstack);
warned = 1;
}
- if (name == 0)
+ if (name == NULL_TREE)
{
if (warned != 1 && code != ENUMERAL_TYPE)
/* Empty unnamed enum OK */
}
else
{
- pending_invalid_xref = 0;
+ pending_invalid_xref = NULL_TREE;
t = lookup_tag (code, name, true, NULL);
if (t == NULL_TREE)
warned = 1;
}
- pending_invalid_xref = 0;
+ pending_invalid_xref = NULL_TREE;
if (declspecs->inline_p)
{
tree origtype, tree asmspec_tree)
{
tree type;
- bool was_incomplete = (DECL_SIZE (decl) == 0);
+ bool was_incomplete = (DECL_SIZE (decl) == NULL_TREE);
const char *asmspec = 0;
/* If a name was specified, get the string. */
record_types_used_by_current_var_decl (decl);
/* If `start_decl' didn't like having an initialization, ignore it now. */
- if (init != 0 && DECL_INITIAL (decl) == 0)
- init = 0;
+ if (init != NULL_TREE && DECL_INITIAL (decl) == NULL_TREE)
+ init = NULL_TREE;
/* Don't crash if parm is initialized. */
if (TREE_CODE (decl) == PARM_DECL)
- init = 0;
+ init = NULL_TREE;
if (init)
store_init_value (init_loc, decl, init, origtype);
/* Deduce size of array from initialization, if not already known. */
if (TREE_CODE (type) == ARRAY_TYPE
- && TYPE_DOMAIN (type) == 0
+ && TYPE_DOMAIN (type) == NULL_TREE
&& TREE_CODE (decl) != TYPE_DECL)
{
bool do_default
if (init && TREE_CODE (init) == CONSTRUCTOR)
add_flexible_array_elts_to_size (decl, init);
- if (DECL_SIZE (decl) == 0 && TREE_TYPE (decl) != error_mark_node
+ if (DECL_SIZE (decl) == NULL_TREE && TREE_TYPE (decl) != error_mark_node
&& COMPLETE_TYPE_P (TREE_TYPE (decl)))
layout_decl (decl, 0);
- if (DECL_SIZE (decl) == 0
+ if (DECL_SIZE (decl) == NULL_TREE
/* Don't give an error if we already gave one earlier. */
&& TREE_TYPE (decl) != error_mark_node
&& (TREE_STATIC (decl)
Also if it is not file scope.
Otherwise, let it through, but if it is not `extern'
then it may cause an error message later. */
- ? (DECL_INITIAL (decl) != 0
+ ? (DECL_INITIAL (decl) != NULL_TREE
|| !DECL_FILE_SCOPE_P (decl))
/* An automatic variable with an incomplete type
is an error. */
&& TREE_STATIC (decl))
incomplete_record_decls.safe_push (decl);
- if (is_global_var (decl) && DECL_SIZE (decl) != 0)
+ if (is_global_var (decl) && DECL_SIZE (decl) != NULL_TREE)
{
if (TREE_CODE (DECL_SIZE (decl)) == INTEGER_CST)
constant_expression_warning (DECL_SIZE (decl));
/* If we used it already as memory, it must stay in memory. */
TREE_ADDRESSABLE (decl) = TREE_USED (decl);
/* If it's still incomplete now, no init will save it. */
- if (DECL_SIZE (decl) == 0)
- DECL_INITIAL (decl) = 0;
+ if (DECL_SIZE (decl) == NULL_TREE)
+ DECL_INITIAL (decl) = NULL_TREE;
}
}
}
default:
gcc_unreachable ();
}
- if (name == 0)
+ if (name == NULL_TREE)
{
gcc_assert (decl_context == PARM
|| decl_context == TYPENAME
error ("%<[*]%> not allowed in other than function prototype scope");
}
- if (arg_types == 0 && !funcdef_flag
+ if (arg_types == NULL_TREE && !funcdef_flag
&& !in_system_header_at (input_location))
warning (OPT_Wstrict_prototypes,
"function declaration isn%'t a prototype");
else
arg_info->parms = arg_info->types;
- arg_info->types = 0;
+ arg_info->types = NULL_TREE;
return 0;
}
else
struct c_binding *b = current_scope->bindings;
struct c_arg_info *arg_info = build_arg_info ();
- tree parms = 0;
+ tree parms = NULL_TREE;
vec<c_arg_tag, va_gc> *tags = NULL;
- tree types = 0;
- tree others = 0;
+ tree types = NULL_TREE;
+ tree others = NULL_TREE;
bool gave_void_only_once_err = false;
(it's impossible to call such a function with type-
correct arguments). An anonymous union parm type is
meaningful as a GNU extension, so don't warn for that. */
- if (TREE_CODE (decl) != UNION_TYPE || b->id != 0)
+ if (TREE_CODE (decl) != UNION_TYPE || b->id != NULL_TREE)
{
if (b->id)
/* The %s will be one of 'struct', 'union', or 'enum'. */
tree_node **slot;
for (x = fieldlist; x ; x = DECL_CHAIN (x))
- if ((y = DECL_NAME (x)) != 0)
+ if ((y = DECL_NAME (x)) != NULL_TREE)
{
slot = htab->find_slot (y, INSERT);
if (*slot)
/* If this type was previously laid out as a forward reference,
make sure we lay it out again. */
- TYPE_SIZE (t) = 0;
+ TYPE_SIZE (t) = NULL_TREE;
decl_attributes (&t, attributes, (int) ATTR_FLAG_TYPE_IN_PLACE);
{
for (x = fieldlist; x; x = DECL_CHAIN (x))
{
- if (DECL_NAME (x) != 0)
+ if (DECL_NAME (x) != NULL_TREE)
break;
if (flag_isoc11 && RECORD_OR_UNION_TYPE_P (TREE_TYPE (x)))
break;
}
- if (x == 0)
+ if (x == NULL_TREE)
{
if (TREE_CODE (t) == UNION_TYPE)
{
= c_build_bitfield_integer_type (width, TYPE_UNSIGNED (type));
SET_DECL_MODE (field, TYPE_MODE (TREE_TYPE (field)));
}
- DECL_INITIAL (field) = 0;
+ DECL_INITIAL (field) = NULL_TREE;
}
else if (TYPE_REVERSE_STORAGE_ORDER (t)
&& TREE_CODE (field) == FIELD_DECL
C_TYPE_BEING_DEFINED (enumtype) = 1;
- if (TYPE_VALUES (enumtype) != 0)
+ if (TYPE_VALUES (enumtype) != NULL_TREE)
{
/* This enum is a named one that has been declared already. */
error_at (loc, "redeclaration of %<enum %E%>", name);
/* Completely replace its old definition.
The old enumerators remain defined, however. */
- TYPE_VALUES (enumtype) = 0;
+ TYPE_VALUES (enumtype) = NULL_TREE;
}
the_enum->enum_next_value = integer_zero_node;
finish_enum (tree enumtype, tree values, tree attributes)
{
tree pair, tem;
- tree minnode = 0, maxnode = 0;
+ tree minnode = NULL_TREE, maxnode = NULL_TREE;
int precision;
signop sign;
bool toplevel = (file_scope == current_scope);
TYPE_MAX_VALUE (enumtype) = TYPE_MAX_VALUE (tem);
TYPE_UNSIGNED (enumtype) = TYPE_UNSIGNED (tem);
SET_TYPE_ALIGN (enumtype, TYPE_ALIGN (tem));
- TYPE_SIZE (enumtype) = 0;
+ TYPE_SIZE (enumtype) = NULL_TREE;
TYPE_PRECISION (enumtype) = TYPE_PRECISION (tem);
layout_type (enumtype);
/* Validate and default VALUE. */
- if (value != 0)
+ if (value != NULL_TREE)
{
/* Don't issue more errors for error_mark_node (i.e. an
undeclared identifier) - just ignore the value expression. */
if (value == error_mark_node)
- value = 0;
+ value = NULL_TREE;
else if (!INTEGRAL_TYPE_P (TREE_TYPE (value)))
{
error_at (loc, "enumerator value for %qE is not an integer constant",
name);
- value = 0;
+ value = NULL_TREE;
}
else
{
{
error ("enumerator value for %qE is not an integer constant",
name);
- value = 0;
+ value = NULL_TREE;
}
else
{
/* Default based on previous value. */
/* It should no longer be possible to have NON_LVALUE_EXPR
in the default. */
- if (value == 0)
+ if (value == NULL_TREE)
{
value = the_enum->enum_next_value;
if (the_enum->enum_overflow)
/* If the declarator is not suitable for a function definition,
cause a syntax error. */
- if (decl1 == 0
+ if (decl1 == NULL_TREE
|| TREE_CODE (decl1) != FUNCTION_DECL)
return 0;
DECL_INITIAL (decl1) = error_mark_node;
/* A nested function is not global. */
- if (current_function_decl != 0)
+ if (current_function_decl != NULL_TREE)
TREE_PUBLIC (decl1) = 0;
/* If this definition isn't a prototype and we had a prototype declaration
before, copy the arg type info from that prototype. */
old_decl = lookup_name_in_scope (DECL_NAME (decl1), current_scope);
if (old_decl && TREE_CODE (old_decl) != FUNCTION_DECL)
- old_decl = 0;
+ old_decl = NULL_TREE;
current_function_prototype_locus = UNKNOWN_LOCATION;
current_function_prototype_built_in = false;
current_function_prototype_arg_types = NULL_TREE;
if (!prototype_p (TREE_TYPE (decl1)))
{
- if (old_decl != 0 && TREE_CODE (TREE_TYPE (old_decl)) == FUNCTION_TYPE
+ if (old_decl != NULL_TREE
+ && TREE_CODE (TREE_TYPE (old_decl)) == FUNCTION_TYPE
&& comptypes (TREE_TYPE (TREE_TYPE (decl1)),
TREE_TYPE (TREE_TYPE (old_decl))))
{
/* Optionally warn of any def with no previous prototype
if the function has already been used. */
else if (warn_missing_prototypes
- && old_decl != 0
+ && old_decl != NULL_TREE
&& old_decl != error_mark_node
&& TREE_USED (old_decl)
&& !prototype_p (TREE_TYPE (old_decl)))
/* Optionally warn of any global def with no previous declaration. */
else if (warn_missing_declarations
&& TREE_PUBLIC (decl1)
- && old_decl == 0
+ && old_decl == NULL_TREE
&& !MAIN_NAME_P (DECL_NAME (decl1))
&& !DECL_DECLARED_INLINE_P (decl1))
warning_at (loc, OPT_Wmissing_declarations,
/* Optionally warn of any def with no previous declaration
if the function has already been used. */
else if (warn_missing_declarations
- && old_decl != 0
+ && old_decl != NULL_TREE
&& old_decl != error_mark_node
&& TREE_USED (old_decl)
&& C_DECL_IMPLICIT (old_decl))
decl in the appropriate TREE_PURPOSE slot of the parmids chain. */
for (parm = parmids; parm; parm = TREE_CHAIN (parm))
{
- if (TREE_VALUE (parm) == 0)
+ if (TREE_VALUE (parm) == NULL_TREE)
{
error_at (DECL_SOURCE_LOCATION (fndecl),
"parameter name missing from parameter list");
- TREE_PURPOSE (parm) = 0;
+ TREE_PURPOSE (parm) = NULL_TREE;
continue;
}
{
error_at (DECL_SOURCE_LOCATION (decl),
"multiple parameters named %qD", decl);
- TREE_PURPOSE (parm) = 0;
+ TREE_PURPOSE (parm) = NULL_TREE;
continue;
}
/* If the declaration says "void", complain and turn it into
/* Chain the declarations together in the order of the list of
names. Store that chain in the function decl, replacing the
list of names. Update the current scope to match. */
- DECL_ARGUMENTS (fndecl) = 0;
+ DECL_ARGUMENTS (fndecl) = NULL_TREE;
for (parm = parmids; parm; parm = TREE_CHAIN (parm))
if (TREE_PURPOSE (parm))
DECL_CHAIN (last) = TREE_PURPOSE (parm);
last = TREE_PURPOSE (parm);
}
- DECL_CHAIN (last) = 0;
+ DECL_CHAIN (last) = NULL_TREE;
}
/* If there was a previous prototype,
}
}
}
- TYPE_ACTUAL_ARG_TYPES (TREE_TYPE (fndecl)) = 0;
+ TYPE_ACTUAL_ARG_TYPES (TREE_TYPE (fndecl)) = NULL_TREE;
}
/* Otherwise, create a prototype that would match. */
else
{
- tree actual = 0, last = 0, type;
+ tree actual = NULL_TREE, last = NULL_TREE, type;
for (parm = DECL_ARGUMENTS (fndecl); parm; parm = DECL_CHAIN (parm))
{
/* But DECL_INITIAL must remain nonzero so we know this
was an actual function definition. */
DECL_INITIAL (current_function_decl) = error_mark_node;
- DECL_ARGUMENTS (current_function_decl) = 0;
+ DECL_ARGUMENTS (current_function_decl) = NULL_TREE;
}
c_stmt_tree = p->base.x_stmt_tree;
standard's definition of "used", and set TREE_NO_WARNING so
that check_global_declaration doesn't repeat the check. */
if (TREE_CODE (decl) == FUNCTION_DECL
- && DECL_INITIAL (decl) == 0
+ && DECL_INITIAL (decl) == NULL_TREE
&& DECL_EXTERNAL (decl)
&& !TREE_PUBLIC (decl))
{
if (TREE_CODE (type) == ERROR_MARK)
return;
- if (value != 0 && (VAR_P (value) || TREE_CODE (value) == PARM_DECL))
+ if (value != NULL_TREE && (VAR_P (value) || TREE_CODE (value) == PARM_DECL))
error_at (loc, "%qD has an incomplete type %qT", value, type);
else
{
t1_complete = COMPLETE_TYPE_P (t1);
t2_complete = COMPLETE_TYPE_P (t2);
- d1_zero = d1 == 0 || !TYPE_MAX_VALUE (d1);
- d2_zero = d2 == 0 || !TYPE_MAX_VALUE (d2);
+ d1_zero = d1 == NULL_TREE || !TYPE_MAX_VALUE (d1);
+ d2_zero = d2 == NULL_TREE || !TYPE_MAX_VALUE (d2);
d1_variable = (!d1_zero
&& (TREE_CODE (TYPE_MIN_VALUE (d1)) != INTEGER_CST
return build_type_attribute_variant (t2, attributes);
/* Simple way if one arg fails to specify argument types. */
- if (TYPE_ARG_TYPES (t1) == 0)
+ if (TYPE_ARG_TYPES (t1) == NULL_TREE)
{
t1 = build_function_type (valtype, TYPE_ARG_TYPES (t2));
t1 = build_type_attribute_variant (t1, attributes);
return qualify_type (t1, t2);
}
- if (TYPE_ARG_TYPES (t2) == 0)
+ if (TYPE_ARG_TYPES (t2) == NULL_TREE)
{
t1 = build_function_type (valtype, TYPE_ARG_TYPES (t1));
t1 = build_type_attribute_variant (t1, attributes);
{
/* A null type means arg type is not specified.
Take whatever the other function type has. */
- if (TREE_VALUE (p1) == 0)
+ if (TREE_VALUE (p1) == NULL_TREE)
{
TREE_VALUE (n) = TREE_VALUE (p2);
goto parm_done;
}
- if (TREE_VALUE (p2) == 0)
+ if (TREE_VALUE (p2) == NULL_TREE)
{
TREE_VALUE (n) = TREE_VALUE (p1);
goto parm_done;
return 0;
if (different_types_p != NULL
- && (d1 == 0) != (d2 == 0))
+ && (d1 == NULL_TREE) != (d2 == NULL_TREE))
*different_types_p = true;
/* Sizes must match unless one is missing or variable. */
- if (d1 == 0 || d2 == 0 || d1 == d2)
+ if (d1 == NULL_TREE || d2 == NULL_TREE || d1 == d2)
break;
d1_zero = !TYPE_MAX_VALUE (d1);
args2 = TYPE_ARG_TYPES (f2);
if (different_types_p != NULL
- && (args1 == 0) != (args2 == 0))
+ && (args1 == NULL_TREE) != (args2 == NULL_TREE))
*different_types_p = true;
/* An unspecified parmlist matches any specified parmlist
whose argument types don't need default promotions. */
- if (args1 == 0)
+ if (args1 == NULL_TREE)
{
if (!self_promoting_args_p (args2))
return 0;
val = 2;
return val;
}
- if (args2 == 0)
+ if (args2 == NULL_TREE)
{
if (!self_promoting_args_p (args1))
return 0;
while (1)
{
tree a1, mv1, a2, mv2;
- if (args1 == 0 && args2 == 0)
+ if (args1 == NULL_TREE && args2 == NULL_TREE)
return val;
/* If one list is shorter than the other,
they fail to match. */
- if (args1 == 0 || args2 == 0)
+ if (args1 == NULL_TREE || args2 == NULL_TREE)
return 0;
mv1 = a1 = TREE_VALUE (args1);
mv2 = a2 = TREE_VALUE (args2);
but nothing is specified about what type it has.
So match anything that self-promotes. */
if (different_types_p != NULL
- && (a1 == 0) != (a2 == 0))
+ && (a1 == NULL_TREE) != (a2 == NULL_TREE))
*different_types_p = true;
- if (a1 == 0)
+ if (a1 == NULL_TREE)
{
if (c_type_promotes_to (a2) != a2)
return 0;
}
- else if (a2 == 0)
+ else if (a2 == NULL_TREE)
{
if (c_type_promotes_to (a1) != a1)
return 0;
/* Allow wait (union {union wait *u; int *i} *)
and wait (union wait *) to be compatible. */
if (TREE_CODE (a1) == UNION_TYPE
- && (TYPE_NAME (a1) == 0
+ && (TYPE_NAME (a1) == NULL_TREE
|| TYPE_TRANSPARENT_AGGR (a1))
&& TREE_CODE (TYPE_SIZE (a1)) == INTEGER_CST
&& tree_int_cst_equal (TYPE_SIZE (a1),
different_types_p))
break;
}
- if (memb == 0)
+ if (memb == NULL_TREE)
return 0;
}
else if (TREE_CODE (a2) == UNION_TYPE
- && (TYPE_NAME (a2) == 0
+ && (TYPE_NAME (a2) == NULL_TREE
|| TYPE_TRANSPARENT_AGGR (a2))
&& TREE_CODE (TYPE_SIZE (a2)) == INTEGER_CST
&& tree_int_cst_equal (TYPE_SIZE (a2),
different_types_p))
break;
}
- if (memb == 0)
+ if (memb == NULL_TREE)
return 0;
}
else
if (/* Don't change a variable array bound or initial value to a constant
in a place where a variable is invalid. Note that DECL_INITIAL
isn't valid for a PARM_DECL. */
- current_function_decl != 0
+ current_function_decl != NULL_TREE
&& TREE_CODE (decl) != PARM_DECL
&& !TREE_THIS_VOLATILE (decl)
&& TREE_READONLY (decl)
- && DECL_INITIAL (decl) != 0
+ && DECL_INITIAL (decl) != NULL_TREE
&& TREE_CODE (DECL_INITIAL (decl)) != ERROR_MARK
/* This is invalid if initial value is not constant.
If it has either a function call, a memory reference,
{
if (!in_sizeof && !in_typeof)
C_DECL_USED (ref) = 1;
- else if (DECL_INITIAL (ref) == 0
+ else if (DECL_INITIAL (ref) == NULL_TREE
&& DECL_EXTERNAL (ref)
&& !TREE_PUBLIC (ref))
record_maybe_used_decl (ref);
ref = DECL_INITIAL (ref);
TREE_CONSTANT (ref) = 1;
}
- else if (current_function_decl != 0
+ else if (current_function_decl != NULL_TREE
&& !DECL_FILE_SCOPE_P (current_function_decl)
&& (VAR_OR_FUNCTION_DECL_P (ref)
|| TREE_CODE (ref) == PARM_DECL))
{
tree context = decl_function_context (ref);
- if (context != 0 && context != current_function_decl)
+ if (context != NULL_TREE && context != current_function_decl)
DECL_NONLOCAL (ref) = 1;
}
/* C99 6.7.4p3: An inline definition of a function with external
linkage ... shall not contain a reference to an identifier with
internal linkage. */
- else if (current_function_decl != 0
+ else if (current_function_decl != NULL_TREE
&& DECL_DECLARED_INLINE_P (current_function_decl)
&& DECL_EXTERNAL (current_function_decl)
&& VAR_OR_FUNCTION_DECL_P (ref)
tree function, vec<tree, va_gc> *params,
vec<tree, va_gc> *origtypes)
{
- tree fntype, fundecl = 0;
+ tree fntype, fundecl = NULL_TREE;
tree name = NULL_TREE, result;
tree tem;
int nargs;
}
}
- if (type != 0)
+ if (type != NULL_TREE)
{
/* Formal parm type is specified by a function prototype. */
gcc_assert (parmnum == vec_safe_length (values));
- if (typetail != 0 && TREE_VALUE (typetail) != void_type_node)
+ if (typetail != NULL_TREE && TREE_VALUE (typetail) != void_type_node)
{
error_at (loc, "too few arguments to function %qE", function);
inform_declaration (fundecl);
{
/* No default_conversion here. It causes trouble for ADDR_EXPR. */
tree arg = xarg;
- tree argtype = 0;
+ tree argtype = NULL_TREE;
enum tree_code typecode;
tree val;
tree ret = error_mark_node;
gcc_unreachable ();
}
- if (argtype == 0)
+ if (argtype == NULL_TREE)
argtype = TREE_TYPE (arg);
if (TREE_CODE (arg) == INTEGER_CST)
ret = (require_constant_value
/* Check if we need to set array size from compound literal size. */
if (TREE_CODE (type) == ARRAY_TYPE
- && TYPE_DOMAIN (type) == 0
+ && TYPE_DOMAIN (type) == NULL_TREE
&& value != error_mark_node)
{
tree inside_init = init;
}
TREE_TYPE (inside_init) = type;
- if (TYPE_DOMAIN (type) != 0
- && TYPE_SIZE (type) != 0
+ if (TYPE_DOMAIN (type) != NULL_TREE
+ && TYPE_SIZE (type) != NULL_TREE
&& TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST)
{
unsigned HOST_WIDE_INT len = TREE_STRING_LENGTH (inside_init);
/* Any type can be initialized
from an expression of the same type, optionally with braces. */
- if (inside_init && TREE_TYPE (inside_init) != 0
+ if (inside_init && TREE_TYPE (inside_init) != NULL_TREE
&& (comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (inside_init)),
TYPE_MAIN_VARIANT (type))
|| (code == ARRAY_TYPE
constructor_designated = 0;
constructor_top_level = top_level;
- if (decl != 0 && decl != error_mark_node)
+ if (decl != NULL_TREE && decl != error_mark_node)
{
require_constant_value = TREE_STATIC (decl);
require_constant_elements
{
struct constructor_stack *p = XNEW (struct constructor_stack);
- if (type == 0)
+ if (type == NULL_TREE)
type = TREE_TYPE (constructor_decl);
if (VECTOR_TYPE_P (type)
{
constructor_fields = TYPE_FIELDS (constructor_type);
/* Skip any nameless bit fields at the beginning. */
- while (constructor_fields != 0 && DECL_C_BIT_FIELD (constructor_fields)
- && DECL_NAME (constructor_fields) == 0)
+ while (constructor_fields != NULL_TREE
+ && DECL_C_BIT_FIELD (constructor_fields)
+ && DECL_NAME (constructor_fields) == NULL_TREE)
constructor_fields = DECL_CHAIN (constructor_fields);
constructor_unfilled_fields = constructor_fields;
while (constructor_stack->implicit)
{
if (RECORD_OR_UNION_TYPE_P (constructor_type)
- && constructor_fields == 0)
+ && constructor_fields == NULL_TREE)
process_init_element (input_location,
pop_init_level (loc, 1, braced_init_obstack,
last_init_list_comma),
p->erroneous = constructor_erroneous;
p->pending_elts = constructor_pending_elts;
p->depth = constructor_depth;
- p->replacement_value.value = 0;
+ p->replacement_value.value = NULL_TREE;
p->replacement_value.original_code = ERROR_MARK;
p->replacement_value.original_type = NULL;
p->implicit = implicit;
/* Don't die if an entire brace-pair level is superfluous
in the containing level. */
- if (constructor_type == 0)
+ if (constructor_type == NULL_TREE)
;
else if (RECORD_OR_UNION_TYPE_P (constructor_type))
{
/* Don't die if there are extra init elts at the end. */
- if (constructor_fields == 0)
- constructor_type = 0;
+ if (constructor_fields == NULL_TREE)
+ constructor_type = NULL_TREE;
else
{
constructor_type = TREE_TYPE (constructor_fields);
constructor_depth++;
}
- if (constructor_type == 0)
+ if (constructor_type == NULL_TREE)
{
error_init (loc, "extra brace group at end of initializer");
- constructor_fields = 0;
- constructor_unfilled_fields = 0;
+ constructor_fields = NULL_TREE;
+ constructor_unfilled_fields = NULL_TREE;
return;
}
{
constructor_fields = TYPE_FIELDS (constructor_type);
/* Skip any nameless bit fields at the beginning. */
- while (constructor_fields != 0 && DECL_C_BIT_FIELD (constructor_fields)
- && DECL_NAME (constructor_fields) == 0)
+ while (constructor_fields != NULL_TREE
+ && DECL_C_BIT_FIELD (constructor_fields)
+ && DECL_NAME (constructor_fields) == NULL_TREE)
constructor_fields = DECL_CHAIN (constructor_fields);
constructor_unfilled_fields = constructor_fields;
{
struct constructor_stack *p;
struct c_expr ret;
- ret.value = 0;
+ ret.value = NULL_TREE;
ret.original_code = ERROR_MARK;
ret.original_type = NULL;
/* If this closes a superfluous brace pair,
just pass out the element between them. */
ret = p->replacement_value;
- else if (constructor_type == 0)
+ else if (constructor_type == NULL_TREE)
;
else if (!RECORD_OR_UNION_TYPE_P (constructor_type)
&& TREE_CODE (constructor_type) != ARRAY_TYPE
constructor_stack = p->next;
free (p);
- if (ret.value == 0 && constructor_stack == 0)
+ if (ret.value == NULL_TREE && constructor_stack == 0)
ret.value = error_mark_node;
return ret;
}
/* Don't die if an entire brace-pair level is superfluous
in the containing level. */
- if (constructor_type == 0)
+ if (constructor_type == NULL_TREE)
return 1;
/* If there were errors in this designator list already, bail out
if (TREE_CODE (first) != INTEGER_CST)
error_init (loc, "nonconstant array index in initializer");
- else if (last != 0 && TREE_CODE (last) != INTEGER_CST)
+ else if (last != NULL_TREE && TREE_CODE (last) != INTEGER_CST)
error_init (loc, "nonconstant array index in initializer");
else if (TREE_CODE (constructor_type) != ARRAY_TYPE)
error_init (loc, "array index in non-array initializer");
if (last)
{
if (tree_int_cst_equal (first, last))
- last = 0;
+ last = NULL_TREE;
else if (tree_int_cst_lt (last, first))
{
error_init (loc, "empty index range in initializer");
- last = 0;
+ last = NULL_TREE;
}
else
{
last = convert (bitsizetype, last);
- if (constructor_max_index != 0
+ if (constructor_max_index != NULL_TREE
&& tree_int_cst_lt (constructor_max_index, last))
{
error_init (loc, "array index range in initializer exceeds "
"array bounds");
- last = 0;
+ last = NULL_TREE;
}
}
}
field = lookup_field (constructor_type, fieldname);
- if (field == 0)
+ if (field == NULL_TREE)
{
tree guessed_id = lookup_field_fuzzy (constructor_type, fieldname);
if (guessed_id)
{
constructor_unfilled_fields = TYPE_FIELDS (constructor_type);
/* Skip any nameless bit fields at the beginning. */
- while (constructor_unfilled_fields != 0
+ while (constructor_unfilled_fields != NULL_TREE
&& DECL_C_BIT_FIELD (constructor_unfilled_fields)
- && DECL_NAME (constructor_unfilled_fields) == 0)
+ && DECL_NAME (constructor_unfilled_fields) == NULL_TREE)
constructor_unfilled_fields = TREE_CHAIN (constructor_unfilled_fields);
}
= DECL_CHAIN (constructor_unfilled_fields);
/* Skip any nameless bit fields. */
- while (constructor_unfilled_fields != 0
+ while (constructor_unfilled_fields != NULL_TREE
&& DECL_C_BIT_FIELD (constructor_unfilled_fields)
- && DECL_NAME (constructor_unfilled_fields) == 0)
+ && DECL_NAME (constructor_unfilled_fields) == NULL_TREE)
constructor_unfilled_fields =
DECL_CHAIN (constructor_unfilled_fields);
}
else if (TREE_CODE (constructor_type) == UNION_TYPE)
- constructor_unfilled_fields = 0;
+ constructor_unfilled_fields = NULL_TREE;
/* Now output any pending elements which have become next. */
if (pending)
output it. Otherwise, set NEXT to the element
that comes first among those still pending. */
- next = 0;
+ next = NULL_TREE;
while (elt)
{
if (TREE_CODE (constructor_type) == ARRAY_TYPE)
tree ctor_unfilled_bitpos, elt_bitpos;
/* If the current record is complete we are done. */
- if (constructor_unfilled_fields == 0)
+ if (constructor_unfilled_fields == NULL_TREE)
break;
ctor_unfilled_bitpos = bit_position (constructor_unfilled_fields);
/* Ordinarily return, but not if we want to output all
and there are elements left. */
- if (!(all && next != 0))
+ if (!(all && next != NULL_TREE))
return;
/* If it's not incremental, just skip over the gap, so that after
struct obstack * braced_init_obstack)
{
tree orig_value = value.value;
- int string_flag = orig_value != 0 && TREE_CODE (orig_value) == STRING_CST;
+ int string_flag
+ = (orig_value != NULL_TREE && TREE_CODE (orig_value) == STRING_CST);
bool strict_string = value.original_code == STRING_CST;
bool was_designated = designator_depth != 0;
return;
}
- if (constructor_stack->replacement_value.value != 0)
+ if (constructor_stack->replacement_value.value != NULL_TREE)
{
error_init (loc, "excess elements in struct initializer");
return;
/* Ignore elements of a brace group if it is entirely superfluous
and has already been diagnosed. */
- if (constructor_type == 0)
+ if (constructor_type == NULL_TREE)
return;
if (!implicit && warn_designated_init && !was_designated
while (constructor_stack->implicit)
{
if (RECORD_OR_UNION_TYPE_P (constructor_type)
- && constructor_fields == 0)
+ && constructor_fields == NULL_TREE)
process_init_element (loc,
pop_init_level (loc, 1, braced_init_obstack,
last_init_list_comma),
tree fieldtype;
enum tree_code fieldcode;
- if (constructor_fields == 0)
+ if (constructor_fields == NULL_TREE)
{
pedwarn_init (loc, 0, "excess elements in struct initializer");
break;
}
/* Accept a string constant to initialize a subarray. */
- if (value.value != 0
+ if (value.value != NULL_TREE
&& fieldcode == ARRAY_TYPE
&& INTEGRAL_TYPE_P (TREE_TYPE (fieldtype))
&& string_flag)
value.value = orig_value;
/* Otherwise, if we have come to a subaggregate,
and we don't have an element of its type, push into it. */
- else if (value.value != 0
+ else if (value.value != NULL_TREE
&& value.value != error_mark_node
&& TYPE_MAIN_VARIANT (TREE_TYPE (value.value)) != fieldtype
&& (fieldcode == RECORD_TYPE || fieldcode == ARRAY_TYPE
constructor_fields = DECL_CHAIN (constructor_fields);
/* Skip any nameless bit fields at the beginning. */
- while (constructor_fields != 0
+ while (constructor_fields != NULL_TREE
&& DECL_C_BIT_FIELD (constructor_fields)
- && DECL_NAME (constructor_fields) == 0)
+ && DECL_NAME (constructor_fields) == NULL_TREE)
constructor_fields = DECL_CHAIN (constructor_fields);
}
else if (TREE_CODE (constructor_type) == UNION_TYPE)
tree fieldtype;
enum tree_code fieldcode;
- if (constructor_fields == 0)
+ if (constructor_fields == NULL_TREE)
{
pedwarn_init (loc, 0,
"excess elements in union initializer");
"of unions");
/* Accept a string constant to initialize a subarray. */
- if (value.value != 0
+ if (value.value != NULL_TREE
&& fieldcode == ARRAY_TYPE
&& INTEGRAL_TYPE_P (TREE_TYPE (fieldtype))
&& string_flag)
value.value = orig_value;
/* Otherwise, if we have come to a subaggregate,
and we don't have an element of its type, push into it. */
- else if (value.value != 0
+ else if (value.value != NULL_TREE
&& value.value != error_mark_node
&& TYPE_MAIN_VARIANT (TREE_TYPE (value.value)) != fieldtype
&& (fieldcode == RECORD_TYPE || fieldcode == ARRAY_TYPE
constructor_unfilled_fields = DECL_CHAIN (constructor_fields);
}
- constructor_fields = 0;
+ constructor_fields = NULL_TREE;
}
else if (TREE_CODE (constructor_type) == ARRAY_TYPE)
{
enum tree_code eltcode = TREE_CODE (elttype);
/* Accept a string constant to initialize a subarray. */
- if (value.value != 0
+ if (value.value != NULL_TREE
&& eltcode == ARRAY_TYPE
&& INTEGRAL_TYPE_P (TREE_TYPE (elttype))
&& string_flag)
value.value = orig_value;
/* Otherwise, if we have come to a subaggregate,
and we don't have an element of its type, push into it. */
- else if (value.value != 0
+ else if (value.value != NULL_TREE
&& value.value != error_mark_node
&& TYPE_MAIN_VARIANT (TREE_TYPE (value.value)) != elttype
&& (eltcode == RECORD_TYPE || eltcode == ARRAY_TYPE
continue;
}
- if (constructor_max_index != 0
+ if (constructor_max_index != NULL_TREE
&& (tree_int_cst_lt (constructor_max_index, constructor_index)
|| integer_all_onesp (constructor_max_index)))
{
/* Handle the sole element allowed in a braced initializer
for a scalar variable. */
else if (constructor_type != error_mark_node
- && constructor_fields == 0)
+ && constructor_fields == NULL_TREE)
{
pedwarn_init (loc, 0,
"excess elements in scalar initializer");
strict_string, constructor_type,
NULL_TREE, 1, implicit,
braced_init_obstack);
- constructor_fields = 0;
+ constructor_fields = NULL_TREE;
}
/* Handle range initializers either at this level or anywhere higher
{
current_function_returns_null = 1;
if ((warn_return_type || flag_isoc99)
- && valtype != 0 && TREE_CODE (valtype) != VOID_TYPE)
+ && valtype != NULL_TREE && TREE_CODE (valtype) != VOID_TYPE)
{
bool warned_here;
if (flag_isoc99)
"declared here");
}
}
- else if (valtype == 0 || TREE_CODE (valtype) == VOID_TYPE)
+ else if (valtype == NULL_TREE || TREE_CODE (valtype) == VOID_TYPE)
{
current_function_returns_null = 1;
bool warned_here;
/* Nonzero means create the expression with this type, rather than
RESULT_TYPE. */
- tree build_type = 0;
+ tree build_type = NULL_TREE;
/* Nonzero means after finally constructing the expression
convert it to this type. */
- tree final_type = 0;
+ tree final_type = NULL_TREE;
/* Nonzero if this is an operation like MIN or MAX which can
safely be computed in short if both args are promoted shorts.
= shorten_compare (location, &xop0, &xop1, &xresult_type,
&xresultcode);
- if (val != 0)
+ if (val != NULL_TREE)
{
ret = val;
goto return_build_binary_op;
: fold_build2_loc (location, resultcode, build_type, op0, op1));
else
ret = build2 (resultcode, build_type, op0, op1);
- if (final_type != 0)
+ if (final_type != NULL_TREE)
ret = convert (final_type, ret);
return_build_binary_op: