]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Improve cleaning up. See hangeLog.
authorPer Bothner <bothner@gcc.gnu.org>
Sun, 30 Apr 1995 21:43:12 +0000 (14:43 -0700)
committerPer Bothner <bothner@gcc.gnu.org>
Sun, 30 Apr 1995 21:43:12 +0000 (14:43 -0700)
From-SVN: r9554

gcc/cpphash.c

index cd7ef05fe136d8034bb795ea8013b83703e0baf1..cb435b4bd43c50155fee8fe3126b86996b0711e4 100644 (file)
@@ -123,18 +123,21 @@ delete_macro (hp)
   if (hp == *hp->bucket_hdr)
     *hp->bucket_hdr = hp->next;
 
-#if 0
-  if (hp->type == T_MACRO) {
-    DEFINITION *d = hp->value.defn;
-    struct reflist *ap, *nextap;
-
-    for (ap = d->pattern; ap != NULL; ap = nextap) {
-      nextap = ap->next;
-      free (ap);
+  if (hp->type == T_MACRO)
+    {
+      DEFINITION *d = hp->value.defn;
+      struct reflist *ap, *nextap;
+
+      for (ap = d->pattern; ap != NULL; ap = nextap)
+       {
+         nextap = ap->next;
+         free (ap);
+       }
+      if (d->nargs >= 0)
+       free (d->args.argnames);
+      free (d);
     }
-    free (d);
-  }
-#endif
+
   free (hp);
 }
 /*
@@ -197,3 +200,15 @@ install (name, len, type, ivalue, value, hash)
   hp->name[len] = 0;
   return hp;
 }
+
+void
+cpp_hash_cleanup (pfile)
+     cpp_reader *pfile;
+{
+  register int i;
+  for (i = HASHSIZE; --i >= 0; )
+    {
+      while (hashtab[i])
+       delete_macro (hashtab[i]);
+    }
+}