aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-08-07 07:39:47 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1993-08-07 07:39:47 -0400
commitc4be79d289a62f217cdda01970d66c5592b7caae (patch)
treed9be11f6e6d5061b1a623d3f1a56b43749553950
parentf3b4fb6ec81b94a31c979ab29db18e6948ea380a (diff)
downloadgcc-c4be79d289a62f217cdda01970d66c5592b7caae.zip
gcc-c4be79d289a62f217cdda01970d66c5592b7caae.tar.gz
gcc-c4be79d289a62f217cdda01970d66c5592b7caae.tar.bz2
(print_obstack_name): New function; derived from original debug_obstack.
(debug_obstack): Call print_obstack_name. From-SVN: r5095
-rw-r--r--gcc/tree.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index b25bc70..84198bd 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -594,8 +594,10 @@ savealloc (size)
/* Print out which obstack an object is in. */
void
-debug_obstack (object)
+print_obstack_name (object, file, prefix)
char *object;
+ FILE *file;
+ char *prefix;
{
struct obstack *obstack = NULL;
char *obstack_name = NULL;
@@ -651,13 +653,21 @@ debug_obstack (object)
{
if (object >= obstack->next_free
&& object < obstack->chunk_limit)
- fprintf (stderr, "object in free portion of obstack %s.\n",
- obstack_name);
+ fprintf (file, "%s in free portion of obstack %s",
+ prefix, obstack_name);
else
- fprintf (stderr, "object allocated from %s.\n", obstack_name);
+ fprintf (file, "%s allocated from %s", prefix, obstack_name);
}
else
- fprintf (stderr, "object not allocated from any obstack.\n");
+ fprintf (file, "%s not allocated from any obstack", prefix);
+}
+
+void
+debug_obstack (object)
+ char *object;
+{
+ print_obstack_name (object, stderr, "object");
+ fprintf (stderr, ".\n");
}
/* Return 1 if OBJ is in the permanent obstack.