This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] cp/class.c: Remove get_enclosing_class.


Hi,

Attached is a patch to remove get_enclosing_class as it is unused.

AFAICT, the last use of get_enclosing was removed in

http://gcc.gnu.org/ml/gcc-patches/2003-07/msg02952.html

So it's been unused for one and half years.

Bootstrapped on i686-pc-linux-gnu.  OK to apply?

Kazu Hirata

2005-01-16  Kazu Hirata  <kazu@cs.umass.edu>

	* class.c (get_enclosing_class): Remove.
	* cp-tree.h: Remove the corresponding prototypes.

Index: class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/class.c,v
retrieving revision 1.700
diff -u -d -p -r1.700 class.c
--- class.c	6 Jan 2005 20:23:36 -0000	1.700
+++ class.c	16 Jan 2005 07:50:31 -0000
@@ -6189,35 +6189,6 @@ contains_empty_class_p (tree type)
   return false;
 }
 
-/* Find the enclosing class of the given NODE.  NODE can be a *_DECL or
-   a *_TYPE node.  NODE can also be a local class.  */
-
-tree
-get_enclosing_class (tree type)
-{
-  tree node = type;
-
-  while (node && TREE_CODE (node) != NAMESPACE_DECL)
-    {
-      switch (TREE_CODE_CLASS (TREE_CODE (node)))
-	{
-	case tcc_declaration:
-	  node = DECL_CONTEXT (node);
-	  break;
-
-	case tcc_type:
-	  if (node != type)
-	    return node;
-	  node = TYPE_CONTEXT (node);
-	  break;
-
-	default:
-	  gcc_unreachable ();
-	}
-    }
-  return NULL_TREE;
-}
-
 /* Note that NAME was looked up while the current class was being
    defined and that the result of that lookup was DECL.  */
 
Index: cp-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/cp-tree.h,v
retrieving revision 1.1088
diff -u -d -p -r1.1088 cp-tree.h
--- cp-tree.h	10 Jan 2005 19:37:05 -0000	1.1088
+++ cp-tree.h	16 Jan 2005 07:50:34 -0000
@@ -3709,7 +3709,6 @@ extern void build_self_reference		(void)
 extern int same_signature_p			(tree, tree);
 extern void warn_hidden				(tree);
 extern void maybe_add_class_template_decl_list	(tree, tree, int);
-extern tree get_enclosing_class			(tree);
 extern void unreverse_member_declarations       (tree);
 extern void invalidate_class_lookup_cache       (void);
 extern void maybe_note_name_used_in_class       (tree, tree);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]