From patchwork Thu Aug 17 12:53:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 802615 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-460507-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Vp5IqIEX"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xY5k323DKz9t42 for ; Thu, 17 Aug 2017 22:53:30 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=RDh2K2Z1va8XcNf6b7gRz8djoYqjU6qGT32OjTowbDvFo/XIst 28I3+e44bRHPRC1qOmoa8kuf6zmcNoWVZHXfmKADEVn0VKuBwFcFx7KqyBqzcmRb dhomyYMPbat9T5QpmgL3YQE2zLhdg5nAFGNR0USmn/AnUOZq2IoBgm1mg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=8Y2NIg2oBrs3hvjwcDlIFE8WC/0=; b=Vp5IqIEXFdjGBzjkaxdP tMz92FV30ROGvgWxaPKQf3nPXnj+pGK7mMouFzU24CHWN53l9tvLM3K+gBLWLu6U az5X4jKCZZS3MsvlBeeE47UMPQNR6OoeCQwuj6O7jq0Erp+miJCz/VH9njbJYgYf pIM3tEb6e1DALOWll1mkeXA= Received: (qmail 64868 invoked by alias); 17 Aug 2017 12:53:22 -0000 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 Received: (qmail 64244 invoked by uid 89); 17 Aug 2017 12:53:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-yw0-f175.google.com Received: from mail-yw0-f175.google.com (HELO mail-yw0-f175.google.com) (209.85.161.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 17 Aug 2017 12:53:19 +0000 Received: by mail-yw0-f175.google.com with SMTP id n83so12351770ywn.2 for ; Thu, 17 Aug 2017 05:53:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-language; bh=sCb9TJ9YMQJcGhb4nYIyRGJuaPx1F7jTpFq3IV7LF0c=; b=JZGOMaQpA60ptKUt0NiVhqGztv+qv7zrrkdRre7Sad7XzqfQluImI1if2Dz19XZ834 XkUsJKD06bh9ouMFXcsDgH9YESSmAv8w6y4mgGbKjgsgZUUu17CnNYmcM3wjs4JvIGPW 20sQabvxuT9XOwK0TUJiV680QH5F4GJlzZ2reVVgthjq7DUdlI/B3dHg+bEni2YSEtB/ I/0K2tK3raDZoWIKJgE3nZ9jSXmhpvQUxtyicY7sa/MylxBrv6VV5Zy5dGQB0vqi4RmO VzzMUlDLtEz7mXXsa4fiNif4kgyRnjX7a15hCdny5KG3vb5PnngIZOfiYc0GG6H2IClh 2JoQ== X-Gm-Message-State: AHYfb5j94oFDKSpKkabsVlC7F2Y9Kn0hd8VuHVY3X3ptdp/Hf+KXpLHw rE0M87/x2eD26w== X-Received: by 10.37.83.133 with SMTP id h127mr4624376ybb.174.1502974397954; Thu, 17 Aug 2017 05:53:17 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a3:20fb:7500:e7fb:4a6f:2254? ([2620:10d:c091:200::1:4ba4]) by smtp.googlemail.com with ESMTPSA id z82sm1203229ywb.1.2017.08.17.05.53.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Aug 2017 05:53:17 -0700 (PDT) To: GCC Patches From: Nathan Sidwell Subject: [C++ PATCH] move template_info field Message-ID: <3418c693-c1ee-1f93-2a1c-a4fc88d4f270@acm.org> Date: Thu, 17 Aug 2017 08:53:15 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 With yesterday's patch to move TYPE_BINFO onto TYPE_MAX_VALUES_RAW, I freed up TYPE_LANG_SLOT_1 for class types. This patch moves template_info from lang_type to that field for both RECORD_TYPESs and BOUND_TEMPLATE_TEMPLATE_PARM_TYPEs. now, you'll notice that TYPE_LANG_SLOT_1 was where ENUMERATION_TYPEs held their TEMPLATE_INFO already, so we now template_info in the same place. That will permit 1) some simplification of TYPE_TEMPLATE_INFO accessor. 2) (I suspect) BOUND_TEMPLATE_TEMPLATE_PARM_TYPEs no longer need TYPE_LANG_SPECIFIC 3) (I suspect) several checks of the form (TYPE_LANG_SPECIFIC (x) && TYPE_TEMPLATE_INFO (x)) can drop the T_L_S check. applied to trunk nathan 2017-08-17 Nathan Sidwell * cp-tree.h (struct lang_type): Remove template_info field. (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1. (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise. Index: cp-tree.h =================================================================== --- cp-tree.h (revision 251144) +++ cp-tree.h (working copy) @@ -471,9 +471,12 @@ extern GTY(()) tree cp_global_trees[CPTI At present, only the six low-order bits are used. TYPE_LANG_SLOT_1 + For a FUNCTION_TYPE or METHOD_TYPE, this is TYPE_RAISES_EXCEPTIONS. + For a POINTER_TYPE (to a METHOD_TYPE), this is TYPE_PTRMEMFUNC_TYPE. For an ENUMERAL_TYPE, this is ENUM_TEMPLATE_INFO. - For a FUNCTION_TYPE or METHOD_TYPE, this is TYPE_RAISES_EXCEPTIONS - For a POINTER_TYPE (to a METHOD_TYPE), this is TYPE_PTRMEMFUNC_TYPE + For a RECORD_TYPE or UNION_TYPE this is CLASSTYPE_TEMPLATE_INFO, + For a BOUND_TEMPLATE_TEMPLATE_PARM_TYPE this is also + TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. BINFO_VIRTUALS For a binfo, this is a TREE_LIST. There is an entry for each @@ -2001,7 +2004,6 @@ struct GTY(()) lang_type { vec * GTY((reorder ("resort_type_method_vec"))) methods; tree key_method; tree decl_list; - tree template_info; tree befriending_classes; /* In a RECORD_TYPE, information specific to Objective-C++, such as a list of adopted protocols or a pointer to a corresponding @@ -3276,7 +3278,7 @@ extern void decl_shadowed_for_var_insert /* Template information for a RECORD_TYPE or UNION_TYPE. */ #define CLASSTYPE_TEMPLATE_INFO(NODE) \ - (LANG_TYPE_CLASS_CHECK (RECORD_OR_UNION_CHECK (NODE))->template_info) + (TYPE_LANG_SLOT_1 (RECORD_OR_UNION_CHECK (NODE))) /* Template information for an ENUMERAL_TYPE. Although an enumeration may not be a primary template, it may be declared within the scope of a @@ -3287,8 +3289,7 @@ extern void decl_shadowed_for_var_insert /* Template information for a template template parameter. */ #define TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO(NODE) \ - (LANG_TYPE_CLASS_CHECK (BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK (NODE)) \ - ->template_info) + (TYPE_LANG_SLOT_1 (BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK (NODE))) /* Template information for an ENUMERAL_, RECORD_, UNION_TYPE, or BOUND_TEMPLATE_TEMPLATE_PARM type. This ignores any alias