diff options
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 6abeda84429..1fea7b93a51 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -6960,6 +6960,50 @@ copy_lang_decl (decl) DECL_LANG_SPECIFIC (decl) = ld; } void +lang_unpickle_tree (t, oldt) + tree t; + tree oldt; +{ + if (TREE_CODE (t) == IDENTIFIER_NODE) + { + struct lang_identifier *i = (struct lang_identifier *) t; + i->global_value = (tree)write_tree (&i->global_value); + i->local_value = (tree) write_tree (&i->local_value); + i->label_value = (tree) write_tree (&i->label_value); + i->implicit_decl = (tree) write_tree (&i->implicit_decl); + i->error_locus = (tree) write_tree (&i->error_locus); + i->limbo_value = (tree) write_tree (&i->limbo_value); + } + else if (TYPE_P (t) && TYPE_LANG_SPECIFIC (t)) + { + struct lang_type *lt; + int id; + if (ggc_set_mark (TYPE_LANG_SPECIFIC (t))) + { + lt = (struct lang_type *) xmalloc (sizeof (struct lang_type)); + memcpy (lt, TYPE_LANG_SPECIFIC (t), sizeof (struct lang_type)); + id = current_id++; + store_to_db (&id, sizeof (int), lt, sizeof (struct lang_type)); + free (lt); + TYPE_LANG_SPECIFIC (t) = (struct lang_type *)id; + } + + } + else if (DECL_P (t) && DECL_LANG_SPECIFIC (t)) + { + struct lang_decl *ld; + int id; + ld = (struct lang_decl *) xmalloc (sizeof (struct lang_decl)); + memcpy (ld, DECL_LANG_SPECIFIC (t), sizeof (struct lang_decl)); + id = current_id++; + ld->base.saved_tree = (tree) write_tree (&ld->base.saved_tree); + ld->pending_sizes = (tree) write_tree (&ld->pending_sizes); + store_to_db (&id, sizeof (int), ld, sizeof (struct lang_decl)); + free (ld); + DECL_LANG_SPECIFIC (t) = (struct lang_decl *)id; + } +} +void lang_pickle_tree (t, oldt) tree t; tree oldt; |