aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2003-05-27 14:44:57 -0400
committerRichard Kenner <kenner@gcc.gnu.org>2003-05-27 14:44:57 -0400
commit7a6cdb44fd51d6036d32a732363f19c8e51f0d89 (patch)
tree6be268fb48b8e0a8cb871503b25decd003ae8522 /gcc/tree.h
parent86982c71d17f2e9888e649fe5c88b65ff84561d8 (diff)
downloadgcc-7a6cdb44fd51d6036d32a732363f19c8e51f0d89.zip
gcc-7a6cdb44fd51d6036d32a732363f19c8e51f0d89.tar.gz
gcc-7a6cdb44fd51d6036d32a732363f19c8e51f0d89.tar.bz2
tree.h (contains_placeholder_p): Now returns bool.
* tree.h (contains_placeholder_p): Now returns bool. (CONTAINS_PLACEHOLDER_P): New macro. (type_contains_placeholder_p): New function. * tree.c (save_expr): Remove code avoiding folding COMPONENT_REF. (contains_placeholder_p): Now returns bool. Rework to use CONTAINS_PLACEHOLDER_P macro. (type_contains_placeholder_p): New function. * fold-const.c (fold, case COMPONENT_REF): Don't fold if type_contains_placeholder_p. (fold_range_test, fold_mathfn_compare, fold_inf_compare, fold): Use CONTAINS_PLACEHOLDER_P macro. * builtins.c (fold_builtin): Likewise. * calls.c (initialize_argument_information): Likewise. * emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise. * explow.c (expr_size): Likewise. * expr.c (store_constructor, get_inner_reference): Likewise. * function.c (assign_parms): Likewise. * stor-layout.c (variable_size): Likewise. From-SVN: r67189
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 2c5f2d9..65b7de2 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2523,7 +2523,19 @@ extern int unsafe_for_reeval PARAMS ((tree));
Note that we only allow such expressions within simple arithmetic
or a COND_EXPR. */
-extern int contains_placeholder_p PARAMS ((tree));
+extern bool contains_placeholder_p PARAMS ((tree));
+
+/* This macro calls the above function but short-circuits the common
+ case of a constant to save time. Also check for null. */
+
+#define CONTAINS_PLACEHOLDER_P(EXP) \
+ ((EXP) != 0 && ! TREE_CONSTANT (EXP) && contains_placeholder_p (EXP))
+
+/* Return 1 if any part of the computation of TYPE involves a PLACEHOLDER_EXPR.
+ This includes size, bounds, qualifiers (for QUAL_UNION_TYPE) and field
+ positions. */
+
+extern bool type_contains_placeholder_p PARAMS ((tree));
/* Return 1 if EXP contains any expressions that produce cleanups for an
outer scope to deal with. Used by fold. */