aboutsummaryrefslogtreecommitdiff
path: root/gdb/psymtab.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2016-11-21 16:50:20 -0700
committerTom Tromey <tom@tromey.com>2017-01-10 19:14:12 -0700
commit906768f970826102252e8cfd30ee72da71de29f7 (patch)
tree638e59e15edbea5651e05a0d8739ede2b2276188 /gdb/psymtab.c
parentbef155c3e8a995fcdb1c2ba5aba012eb653d9f30 (diff)
downloadgdb-906768f970826102252e8cfd30ee72da71de29f7.zip
gdb-906768f970826102252e8cfd30ee72da71de29f7.tar.gz
gdb-906768f970826102252e8cfd30ee72da71de29f7.tar.bz2
Remove make_cleanup_discard_psymtabs
This removes make_cleanup_discard_psymtabs in favor of a new class. 2017-01-10 Tom Tromey <tom@tromey.com> * dwarf2read.c (dwarf2_build_psymtabs): Use psymtab_discarder. * psympriv.h (make_cleanup_discard_psymtabs): Don't declare. * psymtab.c (discard_psymtabs_upto): Remove. (make_cleanup_discard_psymtabs): Remove. (struct psymtab_state): Remove.
Diffstat (limited to 'gdb/psymtab.c')
-rw-r--r--gdb/psymtab.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index e895828..3acc226 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -1832,44 +1832,6 @@ discard_psymtab (struct objfile *objfile, struct partial_symtab *pst)
objfile->free_psymtabs = pst;
}
-/* An object of this type is passed to discard_psymtabs_upto. */
-
-struct psymtab_state
-{
- /* The objfile where psymtabs are discarded. */
-
- struct objfile *objfile;
-
- /* The first psymtab to save. */
-
- struct partial_symtab *save;
-};
-
-/* A cleanup function used by make_cleanup_discard_psymtabs. */
-
-static void
-discard_psymtabs_upto (void *arg)
-{
- struct psymtab_state *state = (struct psymtab_state *) arg;
-
- while (state->objfile->psymtabs != state->save)
- discard_psymtab (state->objfile, state->objfile->psymtabs);
-}
-
-/* Return a new cleanup that discards all psymtabs created in OBJFILE
- after this function is called. */
-
-struct cleanup *
-make_cleanup_discard_psymtabs (struct objfile *objfile)
-{
- struct psymtab_state *state = XNEW (struct psymtab_state);
-
- state->objfile = objfile;
- state->save = objfile->psymtabs;
-
- return make_cleanup_dtor (discard_psymtabs_upto, state, xfree);
-}
-
/* We need to pass a couple of items to the addrmap_foreach function,