aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpphash.c
diff options
context:
space:
mode:
authorPer Bothner <bothner@gcc.gnu.org>1995-04-30 14:43:12 -0700
committerPer Bothner <bothner@gcc.gnu.org>1995-04-30 14:43:12 -0700
commit896fc322095445704ce26291914335cf44902de1 (patch)
treea14115de949ababb20115ebc174147e4f6a55b91 /gcc/cpphash.c
parent75410dc3a6f8e7d05d0417777378c284c5406db7 (diff)
downloadgcc-896fc322095445704ce26291914335cf44902de1.zip
gcc-896fc322095445704ce26291914335cf44902de1.tar.gz
gcc-896fc322095445704ce26291914335cf44902de1.tar.bz2
Improve cleaning up. See hangeLog.
From-SVN: r9554
Diffstat (limited to 'gcc/cpphash.c')
-rw-r--r--gcc/cpphash.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index cd7ef05..cb435b4 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -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]);
+ }
+}