From patchwork Tue Apr 2 13:34:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 232994 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 5D0E22C0141 for ; Wed, 3 Apr 2013 00:34:54 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=RY43CFc5mtqq+VIIVEpJIrA5974ZaaIcNT7QGHr+KcWUFC rP1pbqSZsKenxIbVwj9BEtRlw+uvLQco+e+PpyzAkAVUYo4Yy/H/ik1V9rwyxUNn 9El0ZbiETC+K0Ps1DWHMYG2OH7bnQHxF6XExiZOIUAYYx1hVGRVuJLUqpEcW8= 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 :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=ZHrHKvSFfLkZ4o8ELYDvaUl5W6Q=; b=LR04mT3pMG2JRICiL7hP 8mM6N7u6bOctgCBBupmGub0urRdQy95id8Ilm0xGir6o4cxcXaW/H3C0Fb1NluJG yTNWTv+FTWgyzfXjRMOaPnke06OPkmEUrJBNNAo9FXELCxBV5jbSuzLKTSGVLsdE Vy2jJGpMUHP4ghxoGBx+IFI= Received: (qmail 11028 invoked by alias); 2 Apr 2013 13:34:45 -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 10963 invoked by uid 89); 2 Apr 2013 13:34:38 -0000 X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD autolearn=ham version=3.3.1 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 02 Apr 2013 13:34:35 +0000 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r32DYWwk011461 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 2 Apr 2013 13:34:33 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r32DYWFL028063 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 2 Apr 2013 13:34:32 GMT Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r32DYW16001579 for ; Tue, 2 Apr 2013 08:34:32 -0500 Received: from [192.168.1.4] (/79.53.234.149) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 02 Apr 2013 06:34:32 -0700 Message-ID: <515ADE66.5090007@oracle.com> Date: Tue, 02 Apr 2013 15:34:30 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [C++ Patch] Use TYPE_ALIAS_P, COMPLETE_OR_OPEN_TYPE_P, TYPE_TI_ARGS X-Virus-Found: No Hi, I think this is my last obvious clean-up for now. I'm going to commit it when testing on x86_64-linux completes. Thanks, Paolo. ////////////////////// 2013-04-02 Paolo Carlini * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P. * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS. (for_each_template_parm_r): Use TYPE_TI_ARGS. Index: friend.c =================================================================== --- friend.c (revision 197346) +++ friend.c (working copy) @@ -485,8 +485,7 @@ do_friend (tree ctype, tree declarator, tree decl, to be a friend, so we do lookup here even if CTYPE is in the process of being defined. */ if (class_template_depth - || COMPLETE_TYPE_P (ctype) - || (CLASS_TYPE_P (ctype) && TYPE_BEING_DEFINED (ctype))) + || COMPLETE_OR_OPEN_TYPE_P (ctype)) { if (DECL_TEMPLATE_INFO (decl)) /* DECL is a template specialization. No need to Index: pt.c =================================================================== --- pt.c (revision 197347) +++ pt.c (working copy) @@ -3058,10 +3058,7 @@ find_parameter_packs_r (tree *tp, int *walk_subtre bool parameter_pack_p = false; /* Handle type aliases/typedefs. */ - if (TYPE_P (t) - && TYPE_NAME (t) - && TREE_CODE (TYPE_NAME (t)) == TYPE_DECL - && TYPE_DECL_ALIAS_P (TYPE_NAME (t))) + if (TYPE_ALIAS_P (t)) { if (TYPE_TEMPLATE_INFO (t)) cp_walk_tree (&TYPE_TI_ARGS (t), @@ -3146,7 +3143,7 @@ find_parameter_packs_r (tree *tp, int *walk_subtre case UNION_TYPE: case ENUMERAL_TYPE: if (TYPE_TEMPLATE_INFO (t)) - cp_walk_tree (&TI_ARGS (TYPE_TEMPLATE_INFO (t)), + cp_walk_tree (&TYPE_TI_ARGS (t), &find_parameter_packs_r, ppd, ppd->visited); *walk_subtrees = 0; @@ -7619,7 +7616,7 @@ for_each_template_parm_r (tree *tp, int *walk_subt case ENUMERAL_TYPE: if (!TYPE_TEMPLATE_INFO (t)) *walk_subtrees = 0; - else if (for_each_template_parm (TI_ARGS (TYPE_TEMPLATE_INFO (t)), + else if (for_each_template_parm (TYPE_TI_ARGS (t), fn, data, pfd->visited, pfd->include_nondeduced_p)) return error_mark_node;