+2018-09-26 Martin Sebor <msebor@redhat.com>
+
+ * tree.c (zerop): Change return type to bool.
+ (integer_zerop, integer_onep, integer_each_onep): Same.
+ (integer_all_onesp, integer_minus_onep, integer_pow2p): Same.
+ (integer_nonzerop, integer_truep, tree_ctz, real_zerop): Same.
+ (real_onep, real_minus_onep, chain_index): Same.
+ (print_type_hash_statistics, type_list_equal): Same.
+ * tree.h (zerop): Same.
+ (zerop, integer_zerop, integer_onep, integer_each_onep): Same.
+ (integer_all_onesp, integer_minus_onep, integer_pow2p): Same.
+ (integer_nonzerop, integer_truep, tree_ctz, real_zerop): Same.
+ (real_onep, real_minus_onep, chain_index): Same.
+ (print_type_hash_statistics, type_list_equal): Same.
+
2018-09-26 Jim Wilson <jimw@sifive.com>
* config/riscv/riscv.h (FUNCTION_ARG_REGNO_P): Fix comment.
/* Return 1 if EXPR is the constant zero, whether it is integral, float or
fixed, and scalar, complex or vector. */
-int
+bool
zerop (const_tree expr)
{
return (integer_zerop (expr)
/* Return 1 if EXPR is the integer constant zero or a complex constant
of zero. */
-int
+bool
integer_zerop (const_tree expr)
{
switch (TREE_CODE (expr))
/* Return 1 if EXPR is the integer constant one or the corresponding
complex constant. */
-int
+bool
integer_onep (const_tree expr)
{
switch (TREE_CODE (expr))
/* Return 1 if EXPR is the integer constant one. For complex and vector,
return 1 if every piece is the integer constant one. */
-int
+bool
integer_each_onep (const_tree expr)
{
if (TREE_CODE (expr) == COMPLEX_CST)
/* Return 1 if EXPR is an integer containing all 1's in as much precision as
it contains, or a complex or vector whose subparts are such integers. */
-int
+bool
integer_all_onesp (const_tree expr)
{
if (TREE_CODE (expr) == COMPLEX_CST
&& integer_all_onesp (TREE_REALPART (expr))
&& integer_all_onesp (TREE_IMAGPART (expr)))
- return 1;
+ return true;
else if (TREE_CODE (expr) == VECTOR_CST)
return (VECTOR_CST_NPATTERNS (expr) == 1
&& integer_all_onesp (VECTOR_CST_ENCODED_ELT (expr, 0)));
else if (TREE_CODE (expr) != INTEGER_CST)
- return 0;
+ return false;
return (wi::max_value (TYPE_PRECISION (TREE_TYPE (expr)), UNSIGNED)
== wi::to_wide (expr));
/* Return 1 if EXPR is the integer constant minus one. */
-int
+bool
integer_minus_onep (const_tree expr)
{
if (TREE_CODE (expr) == COMPLEX_CST)
/* Return 1 if EXPR is an integer constant that is a power of 2 (i.e., has only
one bit on). */
-int
+bool
integer_pow2p (const_tree expr)
{
if (TREE_CODE (expr) == COMPLEX_CST
&& integer_pow2p (TREE_REALPART (expr))
&& integer_zerop (TREE_IMAGPART (expr)))
- return 1;
+ return true;
if (TREE_CODE (expr) != INTEGER_CST)
- return 0;
+ return false;
return wi::popcount (wi::to_wide (expr)) == 1;
}
/* Return 1 if EXPR is an integer constant other than zero or a
complex constant other than zero. */
-int
+bool
integer_nonzerop (const_tree expr)
{
return ((TREE_CODE (expr) == INTEGER_CST
return 1 if every piece is the integer constant minus one
(representing the value TRUE). */
-int
+bool
integer_truep (const_tree expr)
{
if (TREE_CODE (expr) == VECTOR_CST)
/* Return 1 if EXPR is the fixed-point constant zero. */
-int
+bool
fixed_zerop (const_tree expr)
{
return (TREE_CODE (expr) == FIXED_CST
/* Return 1 if EXPR is the real constant zero. Trailing zeroes matter for
decimal float constants, so don't return 1 for them. */
-int
+bool
real_zerop (const_tree expr)
{
switch (TREE_CODE (expr))
Trailing zeroes matter for decimal float constants, so don't return
1 for them. */
-int
+bool
real_onep (const_tree expr)
{
switch (TREE_CODE (expr))
/* Return 1 if EXPR is the real constant minus one. Trailing zeroes
matter for decimal float constants, so don't return 1 for them. */
-int
+bool
real_minus_onep (const_tree expr)
{
switch (TREE_CODE (expr))
/* Nonzero if EXP is a constant or a cast of a constant. */
-int
+bool
really_constant_p (const_tree exp)
{
/* This is not quite the same as STRIP_NOPS. It does more. */
/* Return nonzero if ELEM is part of the chain CHAIN. */
-int
+bool
chain_member (const_tree elem, const_tree chain)
{
while (chain)
{
if (elem == chain)
- return 1;
+ return true;
chain = DECL_CHAIN (chain);
}
- return 0;
+ return false;
}
/* Return the length of a chain of nodes chained through TREE_CHAIN.
return 1 if the lists contain the same types in the same order.
Also, the TREE_PURPOSEs must match. */
-int
+bool
type_list_equal (const_tree l1, const_tree l2)
{
const_tree t1, t2;
&& ! (1 == simple_cst_equal (TREE_PURPOSE (t1), TREE_PURPOSE (t2))
&& (TREE_TYPE (TREE_PURPOSE (t1))
== TREE_TYPE (TREE_PURPOSE (t2))))))
- return 0;
+ return false;
return t1 == t2;
}
/* zerop (tree x) is nonzero if X is a constant of value 0. */
-extern int zerop (const_tree);
+extern bool zerop (const_tree);
/* integer_zerop (tree x) is nonzero if X is an integer constant of value 0. */
-extern int integer_zerop (const_tree);
+extern bool integer_zerop (const_tree);
/* integer_onep (tree x) is nonzero if X is an integer constant of value 1. */
-extern int integer_onep (const_tree);
+extern bool integer_onep (const_tree);
/* integer_onep (tree x) is nonzero if X is an integer constant of value 1, or
a vector or complex where each part is 1. */
-extern int integer_each_onep (const_tree);
+extern bool integer_each_onep (const_tree);
/* integer_all_onesp (tree x) is nonzero if X is an integer constant
all of whose significant bits are 1. */
-extern int integer_all_onesp (const_tree);
+extern bool integer_all_onesp (const_tree);
/* integer_minus_onep (tree x) is nonzero if X is an integer constant of
value -1. */
-extern int integer_minus_onep (const_tree);
+extern bool integer_minus_onep (const_tree);
/* integer_pow2p (tree x) is nonzero is X is an integer constant with
exactly one bit 1. */
-extern int integer_pow2p (const_tree);
+extern bool integer_pow2p (const_tree);
/* integer_nonzerop (tree x) is nonzero if X is an integer constant
with a nonzero value. */
-extern int integer_nonzerop (const_tree);
+extern bool integer_nonzerop (const_tree);
/* integer_truep (tree x) is nonzero if X is an integer constant of value 1 or
a vector where each element is an integer constant of value -1. */
-extern int integer_truep (const_tree);
+extern bool integer_truep (const_tree);
extern bool cst_and_fits_in_hwi (const_tree);
extern tree num_ending_zeros (const_tree);
/* fixed_zerop (tree x) is nonzero if X is a fixed-point constant of
value 0. */
-extern int fixed_zerop (const_tree);
+extern bool fixed_zerop (const_tree);
/* staticp (tree x) is nonzero if X is a reference to data allocated
at a fixed address in memory. Returns the outermost data. */
this _DECL with its context, or zero if none. */
extern tree decl_type_context (const_tree);
-/* Return 1 if EXPR is the real constant zero. */
-extern int real_zerop (const_tree);
+/* Return true if EXPR is the real constant zero. */
+extern bool real_zerop (const_tree);
/* Initialize the iterator I with arguments from function FNDECL */
}
extern tree strip_float_extensions (tree);
-extern int really_constant_p (const_tree);
+extern bool really_constant_p (const_tree);
extern bool ptrdiff_tree_p (const_tree, poly_int64_pod *);
extern bool decl_address_invariant_p (const_tree);
extern bool decl_address_ip_invariant_p (const_tree);
}
extern int compare_tree_int (const_tree, unsigned HOST_WIDE_INT);
-extern int type_list_equal (const_tree, const_tree);
-extern int chain_member (const_tree, const_tree);
+extern bool type_list_equal (const_tree, const_tree);
+extern bool chain_member (const_tree, const_tree);
extern void dump_tree_statistics (void);
extern void recompute_tree_invariant_for_addr_expr (tree);
extern bool needs_to_live_in_memory (const_tree);
extern tree reconstruct_complex_type (tree, tree);
-extern int real_onep (const_tree);
-extern int real_minus_onep (const_tree);
+extern bool real_onep (const_tree);
+extern bool real_minus_onep (const_tree);
extern void init_ttree (void);
extern void build_common_tree_nodes (bool);
extern void build_common_builtin_nodes (void);