aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-04-20 14:11:34 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-04-20 14:11:34 +0000
commit87a5b4cc3c685ec64acccc0f9fa25b6a51f60f66 (patch)
treebf0d148c757ab3059e36ba96092c021f4f472894
parent438c239d7629e2107dd831760835895c82f7d8f3 (diff)
downloadgcc-87a5b4cc3c685ec64acccc0f9fa25b6a51f60f66.zip
gcc-87a5b4cc3c685ec64acccc0f9fa25b6a51f60f66.tar.gz
gcc-87a5b4cc3c685ec64acccc0f9fa25b6a51f60f66.tar.bz2
expr.c (handled_component_p): Move ...
2009-04-20 Richard Guenther <rguenther@suse.de> * expr.c (handled_component_p): Move ... * tree.h (handled_component_p): ... here. * tree.def: Re-order BIT_FIELD_REF, COMPONENT_REF, ARRAY_REF, ARRAY_RANGE_REF, VIEW_CONVERT_EXPR, IMAGPART_EXPR and REALPART_EXPR to be in one group. From-SVN: r146427
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/expr.c21
-rw-r--r--gcc/tree.def37
-rw-r--r--gcc/tree.h19
4 files changed, 46 insertions, 39 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0fb7222..1170487 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
2009-04-20 Richard Guenther <rguenther@suse.de>
+ * expr.c (handled_component_p): Move ...
+ * tree.h (handled_component_p): ... here.
+ * tree.def: Re-order BIT_FIELD_REF, COMPONENT_REF,
+ ARRAY_REF, ARRAY_RANGE_REF, VIEW_CONVERT_EXPR, IMAGPART_EXPR
+ and REALPART_EXPR to be in one group.
+
+2009-04-20 Richard Guenther <rguenther@suse.de>
+
* basic-block.h (get_all_dominated_blocks): Declare.
* dominance.c (get_all_dominated_blocks): New function.
* tree-cfg.c (get_all_dominated_blocks): Remove.
diff --git a/gcc/expr.c b/gcc/expr.c
index cd530d0..ce740d2 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -6199,27 +6199,6 @@ component_ref_field_offset (tree exp)
else
return SUBSTITUTE_PLACEHOLDER_IN_EXPR (DECL_FIELD_OFFSET (field), exp);
}
-
-/* Return 1 if T is an expression that get_inner_reference handles. */
-
-int
-handled_component_p (const_tree t)
-{
- switch (TREE_CODE (t))
- {
- case BIT_FIELD_REF:
- case COMPONENT_REF:
- case ARRAY_REF:
- case ARRAY_RANGE_REF:
- case VIEW_CONVERT_EXPR:
- case REALPART_EXPR:
- case IMAGPART_EXPR:
- return 1;
-
- default:
- return 0;
- }
-}
/* Given an rtx VALUE that may contain additions and multiplications, return
an equivalent value that just refers to a register, memory, or constant.
diff --git a/gcc/tree.def b/gcc/tree.def
index a4c524e..41a9e90 100644
--- a/gcc/tree.def
+++ b/gcc/tree.def
@@ -383,6 +383,9 @@ DEFTREECODE (TRANSLATION_UNIT_DECL, "translation_unit_decl",\
/* References to storage. */
+/* The ordering of the following codes is optimized for the classification
+ in handled_component_p. Keep them in a consecutive group. */
+
/* Value is structure or union component.
Operand 0 is the structure or union (an expression).
Operand 1 is the field (a node of type FIELD_DECL).
@@ -400,6 +403,23 @@ DEFTREECODE (COMPONENT_REF, "component_ref", tcc_reference, 3)
to its mode width. */
DEFTREECODE (BIT_FIELD_REF, "bit_field_ref", tcc_reference, 3)
+/* Used only on an operand of complex type, these return
+ a value of the corresponding component type. */
+DEFTREECODE (REALPART_EXPR, "realpart_expr", tcc_reference, 1)
+DEFTREECODE (IMAGPART_EXPR, "imagpart_expr", tcc_reference, 1)
+
+/* Array indexing.
+ Operand 0 is the array; operand 1 is a (single) array index.
+ Operand 2, if present, is a copy of TYPE_MIN_VALUE of the index.
+ Operand 3, if present, is the element size, measured in units of
+ the alignment of the element type. */
+DEFTREECODE (ARRAY_REF, "array_ref", tcc_reference, 4)
+
+/* Likewise, except that the result is a range ("slice") of the array. The
+ starting index of the resulting array is taken from operand 1 and the size
+ of the range is taken from the type of the expression. */
+DEFTREECODE (ARRAY_RANGE_REF, "array_range_ref", tcc_reference, 4)
+
/* The ordering of the following codes is optimized for the checking
macros in tree.h. Changing the order will degrade the speed of the
compiler. INDIRECT_REF, ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF. */
@@ -418,18 +438,6 @@ DEFTREECODE (ALIGN_INDIRECT_REF, "align_indirect_ref", tcc_reference, 1)
or 0 if the alignment is unknown. */
DEFTREECODE (MISALIGNED_INDIRECT_REF, "misaligned_indirect_ref", tcc_reference, 2)
-/* Array indexing.
- Operand 0 is the array; operand 1 is a (single) array index.
- Operand 2, if present, is a copy of TYPE_MIN_VALUE of the index.
- Operand 3, if present, is the element size, measured in units of
- the alignment of the element type. */
-DEFTREECODE (ARRAY_REF, "array_ref", tcc_reference, 4)
-
-/* Likewise, except that the result is a range ("slice") of the array. The
- starting index of the resulting array is taken from operand 1 and the size
- of the range is taken from the type of the expression. */
-DEFTREECODE (ARRAY_RANGE_REF, "array_range_ref", tcc_reference, 4)
-
/* Used to represent lookup of runtime type dependent data. Often this is
a reference to a vtable, but it needn't be. Operands are:
OBJ_TYPE_REF_EXPR: An expression that evaluates the value to use.
@@ -806,11 +814,6 @@ DEFTREECODE (COMPLEX_EXPR, "complex_expr", tcc_binary, 2)
/* Complex conjugate of operand. Used only on complex types. */
DEFTREECODE (CONJ_EXPR, "conj_expr", tcc_unary, 1)
-/* Used only on an operand of complex type, these return
- a value of the corresponding component type. */
-DEFTREECODE (REALPART_EXPR, "realpart_expr", tcc_reference, 1)
-DEFTREECODE (IMAGPART_EXPR, "imagpart_expr", tcc_reference, 1)
-
/* Nodes for ++ and -- in C.
The second arg is how much to increment or decrement by.
For a pointer, it would be the size of the object pointed to. */
diff --git a/gcc/tree.h b/gcc/tree.h
index c5c855f..8902b43 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -4503,7 +4503,24 @@ extern tree get_narrower (tree, int *);
/* Return true if T is an expression that get_inner_reference handles. */
-extern int handled_component_p (const_tree);
+static inline bool
+handled_component_p (const_tree t)
+{
+ switch (TREE_CODE (t))
+ {
+ case BIT_FIELD_REF:
+ case COMPONENT_REF:
+ case ARRAY_REF:
+ case ARRAY_RANGE_REF:
+ case VIEW_CONVERT_EXPR:
+ case REALPART_EXPR:
+ case IMAGPART_EXPR:
+ return true;
+
+ default:
+ return false;
+ }
+}
/* Given an expression EXP that is a handled_component_p,
look for the ultimate containing object, which is returned and specify