From patchwork Fri Apr 22 13:23:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 92532 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 9E49FB6F65 for ; Fri, 22 Apr 2011 23:23:55 +1000 (EST) Received: (qmail 8895 invoked by alias); 22 Apr 2011 13:23:53 -0000 Received: (qmail 8887 invoked by uid 22791); 22 Apr 2011 13:23:52 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, TW_FN, TW_VT X-Spam-Check-By: sourceware.org Received: from cantor.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 22 Apr 2011 13:23:37 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 6F6E293EE3 for ; Fri, 22 Apr 2011 15:23:36 +0200 (CEST) Date: Fri, 22 Apr 2011 15:23:35 +0200 From: Martin Jambor To: GCC Patches Subject: [PATCH, C++] Remove unused cp_fold_obj_type_ref Message-ID: <20110422132335.GB331@virgil.arch.suse.de> Mail-Followup-To: GCC Patches MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 * 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);