This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: C++ dead code elimination
- From: "Ollie Wild" <aaw at google dot com>
- To: "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 21 Aug 2007 13:38:58 -0700
- Subject: PATCH: C++ dead code elimination
This tiny patch removes the vtables chain from struct
cp_binding_level. The code which appended to it was never being
triggered, and it wasn't referenced elsewhere.
Tested with a C/C++/Java bootstrap and testsuite on i686-pc-linux-gnu.
Ollie
:ADDPATCH c++:
2007-08-21 Ollie Wild <aaw@google.com>
* name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
* name-lookup.h (cp_binding_level): Remove vtables member.
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 5f7e718..b5f27c3 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -542,11 +542,6 @@ add_decl_to_level (tree decl, cxx_scope *b)
TREE_CHAIN (decl) = b->namespaces;
b->namespaces = decl;
}
- else if (TREE_CODE (decl) == VAR_DECL && DECL_VIRTUAL_P (decl))
- {
- TREE_CHAIN (decl) = b->vtables;
- b->vtables = decl;
- }
else
{
/* We build up the list in reverse order, and reverse it later if
diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h
index d82445f..88551f2 100644
--- a/gcc/cp/name-lookup.h
+++ b/gcc/cp/name-lookup.h
@@ -190,9 +190,6 @@ struct cp_binding_level GTY(())
/* An array of static functions and variables (for namespaces only) */
VEC(tree,gc) *static_decls;
- /* A chain of VTABLE_DECL nodes. */
- tree vtables;
-
/* A list of USING_DECL nodes. */
tree usings;