public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Jambor <mjambor@suse.cz>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: [PATCH, C++] Remove unused cp_fold_obj_type_ref
Date: Fri, 22 Apr 2011 14:39:00 -0000	[thread overview]
Message-ID: <20110422132335.GB331@virgil.arch.suse.de> (raw)

Hi,

last year I removed the last use of cp_fold_obj_type_ref (which was a
language hook) but forgot to remove the function itself.  So I'm about
to do it now.

I'm currently bootstrapping and testing the following patch.  I
consider it obvious enough to commit it myself on Tuesday if it
passes.

Thanks,

Martin


2011-04-22  Martin Jambor  <mjambor@suse.cz>

	* class.c (cp_fold_obj_type_ref): Remove.
	* cp-tree.h (cp_fold_obj_type_ref): Remove declaration.

Index: src/gcc/cp/class.c
===================================================================
--- src.orig/gcc/cp/class.c
+++ src/gcc/cp/class.c
@@ -8377,32 +8377,4 @@ build_rtti_vtbl_entries (tree binfo, vtb
   CONSTRUCTOR_APPEND_ELT (vid->inits, NULL_TREE, init);
 }
 
-/* Fold a OBJ_TYPE_REF expression to the address of a function.
-   KNOWN_TYPE carries the true type of OBJ_TYPE_REF_OBJECT(REF).  */
-
-tree
-cp_fold_obj_type_ref (tree ref, tree known_type)
-{
-  HOST_WIDE_INT index = tree_low_cst (OBJ_TYPE_REF_TOKEN (ref), 1);
-  HOST_WIDE_INT i = 0;
-  tree v = BINFO_VIRTUALS (TYPE_BINFO (known_type));
-  tree fndecl;
-
-  while (i != index)
-    {
-      i += (TARGET_VTABLE_USES_DESCRIPTORS
-	    ? TARGET_VTABLE_USES_DESCRIPTORS : 1);
-      v = TREE_CHAIN (v);
-    }
-
-  fndecl = BV_FN (v);
-
-#ifdef ENABLE_CHECKING
-  gcc_assert (tree_int_cst_equal (OBJ_TYPE_REF_TOKEN (ref),
-				  DECL_VINDEX (fndecl)));
-#endif
-
-  return build_address (fndecl);
-}
-
 #include "gt-cp-class.h"
Index: src/gcc/cp/cp-tree.h
===================================================================
--- src.orig/gcc/cp/cp-tree.h
+++ src/gcc/cp/cp-tree.h
@@ -4713,7 +4713,6 @@ extern void note_name_declared_in_class
 extern tree get_vtbl_decl_for_binfo		(tree);
 extern void debug_class				(tree);
 extern void debug_thunks			(tree);
-extern tree cp_fold_obj_type_ref		(tree, tree);
 extern void set_linkage_according_to_type	(tree, tree);
 extern void determine_key_method		(tree);
 extern void check_for_override			(tree, tree);

             reply	other threads:[~2011-04-22 13:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-22 14:39 Martin Jambor [this message]
2011-04-26 18:59 ` Rainer Orth
2011-04-26 22:06   ` Jason Merrill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110422132335.GB331@virgil.arch.suse.de \
    --to=mjambor@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).