(print_obstack_name): New function; derived from original debug_obstack.
authorRichard Kenner <kenner@gcc.gnu.org>
Sat, 7 Aug 1993 11:39:47 +0000 (07:39 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Sat, 7 Aug 1993 11:39:47 +0000 (07:39 -0400)
(debug_obstack): Call print_obstack_name.

From-SVN: r5095

gcc/tree.c

index b25bc70bc8fae4e282bc1698592c8a787c1f6824..84198bdda8f4907a52de85beac44470816a6d956 100644 (file)
@@ -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.