summaryrefslogtreecommitdiffstats
path: root/gcc/sdbout.c
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1995-05-04 18:14:53 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1995-05-04 18:14:53 +0000
commitd4e7442d33f239504da5ce756ce19baabdc9a171 (patch)
tree0bae83ca5f42d07b780c64691df185ed01441383 /gcc/sdbout.c
parent5b94bdcdb88548ae50fe4ab5279c6b6c8c4eb6c0 (diff)
downloadppe42-gcc-d4e7442d33f239504da5ce756ce19baabdc9a171.tar.gz
ppe42-gcc-d4e7442d33f239504da5ce756ce19baabdc9a171.zip
(plain_type): Pass additional argument to plain_type_1.
(plain_type_1): New parameter level. Increment it when making recursive calls. Force the type to void_type_mode before starting a 7th level of recursion. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9572 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sdbout.c')
-rw-r--r--gcc/sdbout.c35
1 files changed, 28 insertions, 7 deletions
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
index 07bbcc6ebc7..b08a6ebb449 100644
--- a/gcc/sdbout.c
+++ b/gcc/sdbout.c
@@ -369,7 +369,7 @@ static int
plain_type (type)
tree type;
{
- int val = plain_type_1 (type);
+ int val = plain_type_1 (type, 0);
/* If we have already saved up some array dimensions, print them now. */
if (sdb_n_dims > 0)
@@ -449,15 +449,25 @@ sdbout_record_type_name (type)
#endif
}
+/* Return the .type value for type TYPE.
+
+ LEVEL indicates how many levels deep we have recursed into the type.
+ The SDB debug format can only represent 6 derived levels of types.
+ After that, we must output inaccurate debug info. We deliberately
+ stop before the 7th level, so that ADA recursive types will not give an
+ infinite loop. */
+
static int
-plain_type_1 (type)
+plain_type_1 (type, level)
tree type;
+ int level;
{
if (type == 0)
type = void_type_node;
- if (type == error_mark_node)
+ else if (type == error_mark_node)
type = integer_type_node;
- type = TYPE_MAIN_VARIANT (type);
+ else
+ type = TYPE_MAIN_VARIANT (type);
switch (TREE_CODE (type))
{
@@ -520,7 +530,10 @@ plain_type_1 (type)
case ARRAY_TYPE:
{
int m;
- m = plain_type_1 (TREE_TYPE (type));
+ if (level >= 6)
+ return T_VOID;
+ else
+ m = plain_type_1 (TREE_TYPE (type), level+1);
if (sdb_n_dims < SDB_MAX_DIM)
sdb_dims[sdb_n_dims++]
= (TYPE_DOMAIN (type)
@@ -569,13 +582,21 @@ plain_type_1 (type)
case POINTER_TYPE:
case REFERENCE_TYPE:
{
- int m = plain_type_1 (TREE_TYPE (type));
+ int m;
+ if (level >= 6)
+ return T_VOID;
+ else
+ m = plain_type_1 (TREE_TYPE (type), level+1);
return PUSH_DERIVED_LEVEL (DT_PTR, m);
}
case FUNCTION_TYPE:
case METHOD_TYPE:
{
- int m = plain_type_1 (TREE_TYPE (type));
+ int m;
+ if (level >= 6)
+ return T_VOID;
+ else
+ m = plain_type_1 (TREE_TYPE (type), level+1);
return PUSH_DERIVED_LEVEL (DT_FCN, m);
}
default:
OpenPOWER on IntegriCloud