aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2010-11-09 11:59:55 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2010-11-09 11:59:55 +0000
commit98cd3025d4d3204a18f327627a61b6773fd377a5 (patch)
treef3683767b5743cd5036a7a65c1816ad7f965366b /gcc/tree.c
parentb9cb66d281d279a13ed9628a9046e4523cb677d5 (diff)
downloadgcc-98cd3025d4d3204a18f327627a61b6773fd377a5.zip
gcc-98cd3025d4d3204a18f327627a61b6773fd377a5.tar.gz
gcc-98cd3025d4d3204a18f327627a61b6773fd377a5.tar.bz2
tree.h (contains_placeholder_p): Fix comment.
* tree.h (contains_placeholder_p): Fix comment. (type_contains_placeholder_p): Adjust comment. * tree.c (contains_placeholder_p): Fix comment. (type_contains_placeholder_1): Do not recurse on pointed-to types and adjust comment. (type_contains_placeholder_p): Add comment. ada/ * gcc-interface/decl.c (finish_fat_pointer_type): New function. (gnat_to_gnu_entity) <E_Array_Type>: Use it to build the fat pointer type. <E_Access_Type>: Likewise. From-SVN: r166484
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 4a27fd2..756ceaa 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -2795,8 +2795,8 @@ process_call_operands (tree t)
TREE_READONLY (t) = read_only;
}
-/* Return 1 if EXP contains a PLACEHOLDER_EXPR; i.e., if it represents a size
- or offset that depends on a field within a record. */
+/* Return true if EXP contains a PLACEHOLDER_EXPR, i.e. if it represents a
+ size or offset that depends on a field within a record. */
bool
contains_placeholder_p (const_tree exp)
@@ -2882,9 +2882,9 @@ contains_placeholder_p (const_tree exp)
return 0;
}
-/* Return true if any part of the computation of TYPE involves a
- PLACEHOLDER_EXPR. This includes size, bounds, qualifiers
- (for QUAL_UNION_TYPE) and field positions. */
+/* Return true if any part of the structure of TYPE involves a PLACEHOLDER_EXPR
+ directly. This includes size, bounds, qualifiers (for QUAL_UNION_TYPE) and
+ field positions. */
static bool
type_contains_placeholder_1 (const_tree type)
@@ -2893,7 +2893,8 @@ type_contains_placeholder_1 (const_tree type)
the case of arrays) type involves a placeholder, this type does. */
if (CONTAINS_PLACEHOLDER_P (TYPE_SIZE (type))
|| CONTAINS_PLACEHOLDER_P (TYPE_SIZE_UNIT (type))
- || (TREE_TYPE (type) != 0
+ || (!POINTER_TYPE_P (type)
+ && TREE_TYPE (type)
&& type_contains_placeholder_p (TREE_TYPE (type))))
return true;
@@ -2921,8 +2922,8 @@ type_contains_placeholder_1 (const_tree type)
|| CONTAINS_PLACEHOLDER_P (TYPE_MAX_VALUE (type)));
case ARRAY_TYPE:
- /* We're already checked the component type (TREE_TYPE), so just check
- the index type. */
+ /* We have already checked the component type above, so just check the
+ domain type. */
return type_contains_placeholder_p (TYPE_DOMAIN (type));
case RECORD_TYPE:
@@ -2947,6 +2948,8 @@ type_contains_placeholder_1 (const_tree type)
}
}
+/* Wrapper around above function used to cache its result. */
+
bool
type_contains_placeholder_p (tree type)
{