]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree.c (cp_free_lang_data): Free DECL_NAMESPACE_USERS and clear DECL_CHAIN of NAMESPA...
authorRichard Guenther <rguenther@suse.de>
Wed, 13 Oct 2010 08:15:47 +0000 (08:15 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 13 Oct 2010 08:15:47 +0000 (08:15 +0000)
2010-10-12  Richard Guenther  <rguenther@suse.de>

* tree.c (cp_free_lang_data): Free DECL_NAMESPACE_USERS and
clear DECL_CHAIN of NAMESPACE_DECLs.

From-SVN: r165413

gcc/cp/ChangeLog
gcc/cp/tree.c

index 5b0890627b7c12a394067fb010290ed68c0f323c..9ac7a4a605ba1b337d44437617f7aaef5923eda1 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-13  Richard Guenther  <rguenther@suse.de>
+
+       * tree.c (cp_free_lang_data): Free DECL_NAMESPACE_USERS and
+       clear DECL_CHAIN of NAMESPACE_DECLs.
+
 2010-10-11  Martin Jambor  <mjambor@suse.cz>
 
        PR c++/45562
index 174500ef66f3b74672eee4a454276c56c23ce5b5..93d13a1ec2b367f6121cc635e6ec59cd8b94592d 100644 (file)
@@ -3265,6 +3265,15 @@ cp_free_lang_data (tree t)
          && ANON_AGGRNAME_P (name))
        TYPE_NAME (t) = NULL_TREE;
     }
+  if (TREE_CODE (t) == NAMESPACE_DECL)
+    {
+      /* The list of users of a namespace isn't useful for the middle-end
+        or debug generators.  */
+      DECL_NAMESPACE_USERS (t) = NULL_TREE;
+      /* Neither do we need the leftover chaining of namespaces
+         from the binding level.  */
+      DECL_CHAIN (t) = NULL_TREE;
+    }
 }
 
 /* Stub for c-common.  Please keep in sync with c-decl.c.