aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index a8edda7..a85b4c6 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -4838,6 +4838,17 @@ extern bool tree_expr_nonzero_warnv_p (tree, bool *);
extern bool fold_real_zero_addition_p (const_tree, const_tree, int);
+/* Return nonzero if CODE is a tree code that represents a truth value. */
+static inline bool
+truth_value_p (enum tree_code code)
+{
+ return (TREE_CODE_CLASS (code) == tcc_comparison
+ || code == TRUTH_AND_EXPR || code == TRUTH_ANDIF_EXPR
+ || code == TRUTH_OR_EXPR || code == TRUTH_ORIF_EXPR
+ || code == TRUTH_XOR_EXPR || code == TRUTH_NOT_EXPR);
+}
+
+
/* In builtins.c */
extern tree fold_call_expr (tree, bool);
extern tree fold_builtin_fputs (tree, tree, bool, bool, tree);