summaryrefslogtreecommitdiff
path: root/gcc/cpppch.c
diff options
context:
space:
mode:
authoraustern <austern@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-03 21:00:56 +0000
committeraustern <austern@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-03 21:00:56 +0000
commit78e9fc5073efe5a72073621400ad34aeec481bd5 (patch)
treedbb1adecad038d29321ac64a1fb29c837c4b0c87 /gcc/cpppch.c
parentcbf55766ae0f73a61a54d56d442e43ed6eac8d42 (diff)
downloadgcc-78e9fc5073efe5a72073621400ad34aeec481bd5.tar.gz
* cpppch.c (reset_ht): Remove.
(cpp_read_state): Remove loop to reset hashtable identifiers. * ggc-common.c (gt_pch_save): Add call to gt_pch_fixup_stringpool after pch file is written. * ggc.h (gt_pch_fixup_stringpool): Declare. * stringpool.c (ht_copy_and_clear): Define. Callback. Copy hashnode's value to another hashtable, then clear the original. (saved_ident_hash): Define. (gt_pch_save_stringpool): Create saved_ident_hash, use it to store definitions in ident_hash, and clear ident_hash. (gt_pch_fixup_stringpool): Define. Restore definitions from saved_ident_hash to ident_hash, then destroy saved_ident_hash. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65215 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpppch.c')
-rw-r--r--gcc/cpppch.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/gcc/cpppch.c b/gcc/cpppch.c
index 0ee04ea2024..637160cd1a8 100644
--- a/gcc/cpppch.c
+++ b/gcc/cpppch.c
@@ -34,7 +34,6 @@ static int comp_hashnodes PARAMS ((const void *, const void *));
static int collect_ht_nodes PARAMS ((cpp_reader *, cpp_hashnode *, void *));
static int write_defs PARAMS ((cpp_reader *, cpp_hashnode *, void *));
static int save_macros PARAMS ((cpp_reader *, cpp_hashnode *, void *));
-static int reset_ht PARAMS ((cpp_reader *, cpp_hashnode *, void *));
/* This structure represents a macro definition on disk. */
struct macrodef_struct
@@ -628,23 +627,6 @@ cpp_prepare_state (r, data)
*data = d;
}
-/* Erase all the existing macros and assertions. */
-
-static int
-reset_ht (r, h, unused)
- cpp_reader *r ATTRIBUTE_UNUSED;
- cpp_hashnode *h;
- void *unused ATTRIBUTE_UNUSED;
-{
- if (h->type != NT_VOID
- && (h->flags & NODE_BUILTIN) == 0)
- {
- h->type = NT_VOID;
- memset (&h->value, 0, sizeof (h->value));
- }
- return 1;
-}
-
/* Given a precompiled header that was previously determined to be valid,
apply all its definitions (and undefinitions) to the current state.
DEPNAME is passed to deps_restore. */
@@ -664,11 +646,6 @@ cpp_read_state (r, name, f, data)
size_t i, mac_count;
int saved_line = r->line;
- /* Erase all the existing hashtable entries for macros. At this
- point, they're all from the PCH file, and their pointers won't be
- valid. */
- cpp_forall_identifiers (r, reset_ht, NULL);
-
/* Restore spec_nodes, which will be full of references to the old
hashtable entries and so will now be invalid. */
{