From patchwork Wed Oct 26 16:41:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 121944 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 6866DB6F92 for ; Thu, 27 Oct 2011 03:49:52 +1100 (EST) Received: (qmail 7905 invoked by alias); 26 Oct 2011 16:42:28 -0000 Received: (qmail 7892 invoked by uid 22791); 26 Oct 2011 16:42:27 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from acsinet15.oracle.com (HELO acsinet15.oracle.com) (141.146.126.227) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 26 Oct 2011 16:42:08 +0000 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p9QGg66p027451 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 26 Oct 2011 16:42:07 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p9QGg5FQ001936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 26 Oct 2011 16:42:06 GMT Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p9QGg09n016513; Wed, 26 Oct 2011 11:42:00 -0500 Received: from [192.168.1.4] (/79.51.11.135) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 26 Oct 2011 09:42:00 -0700 Message-ID: <4EA83852.4020105@oracle.com> Date: Wed, 26 Oct 2011 18:41:54 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Jason Merrill Subject: [C++ Patch] BASELINK_P clean up 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, we have an inconsistent mix: shall we do the below? Test in progress on x86_64-linux. Thanks, Paolo. ////////////////// 2011-10-26 Paolo Carlini * typeck.c (cp_build_addr_expr_1): Use BASELINK_P. * class.c (instantiate_type): Likewise. * pt.c (convert_nontype_argument_function, uses_template_parms, tsubst_copy, resolve_nondeduced_context, type_dependent_expression_p): Likewise. * semantics.c (finish_decltype_type): Likewise. * decl2.c (mark_used): Likewise. * name-lookup.c (arg_assoc): Likewise. Index: typeck.c =================================================================== --- typeck.c (revision 180528) +++ typeck.c (working copy) @@ -4946,7 +4946,7 @@ cp_build_addr_expr_1 (tree arg, bool strict_lvalue if (TREE_CODE (arg) == OFFSET_REF) PTRMEM_OK_P (val) = PTRMEM_OK_P (arg); } - else if (TREE_CODE (TREE_OPERAND (arg, 1)) == BASELINK) + else if (BASELINK_P (TREE_OPERAND (arg, 1))) { tree fn = BASELINK_FUNCTIONS (TREE_OPERAND (arg, 1)); Index: class.c =================================================================== --- class.c (revision 180528) +++ class.c (working copy) @@ -6873,7 +6873,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_f } } - if (TREE_CODE (rhs) == BASELINK) + if (BASELINK_P (rhs)) { access_path = BASELINK_ACCESS_BINFO (rhs); rhs = BASELINK_FUNCTIONS (rhs); Index: pt.c =================================================================== --- pt.c (revision 180528) +++ pt.c (working copy) @@ -5277,7 +5277,7 @@ convert_nontype_argument_function (tree type, tree fn_no_ptr = fn; if (TREE_CODE (fn_no_ptr) == ADDR_EXPR) fn_no_ptr = TREE_OPERAND (fn_no_ptr, 0); - if (TREE_CODE (fn_no_ptr) == BASELINK) + if (BASELINK_P (fn_no_ptr)) fn_no_ptr = BASELINK_FUNCTIONS (fn_no_ptr); /* [temp.arg.nontype]/1 @@ -7801,7 +7801,7 @@ uses_template_parms (tree t) || EXPR_P (t) || TREE_CODE (t) == TEMPLATE_PARM_INDEX || TREE_CODE (t) == OVERLOAD - || TREE_CODE (t) == BASELINK + || BASELINK_P (t) || TREE_CODE (t) == IDENTIFIER_NODE || TREE_CODE (t) == TRAIT_EXPR || TREE_CODE (t) == CONSTRUCTOR @@ -11993,7 +11993,7 @@ tsubst_copy (tree t, tree args, tsubst_flags_t com base, name, /*template_p=*/false); } - else if (TREE_CODE (name) == BASELINK) + else if (BASELINK_P (name)) name = tsubst_baselink (name, non_reference (TREE_TYPE (object)), args, complain, @@ -15197,7 +15197,7 @@ resolve_nondeduced_context (tree orig_expr) offset = expr; expr = TREE_OPERAND (expr, 1); } - if (TREE_CODE (expr) == BASELINK) + if (BASELINK_P (expr)) { baselink = expr; expr = BASELINK_FUNCTIONS (expr); @@ -19314,7 +19314,7 @@ type_dependent_expression_p (tree expression) if (TREE_CODE (expression) == SCOPE_REF) return false; - if (TREE_CODE (expression) == BASELINK) + if (BASELINK_P (expression)) expression = BASELINK_FUNCTIONS (expression); if (TREE_CODE (expression) == TEMPLATE_ID_EXPR) Index: semantics.c =================================================================== --- semantics.c (revision 180528) +++ semantics.c (working copy) @@ -5115,7 +5115,7 @@ finish_decltype_type (tree expr, bool id_expressio step. */ expr = TREE_OPERAND (expr, 1); - if (TREE_CODE (expr) == BASELINK) + if (BASELINK_P (expr)) /* See through BASELINK nodes to the underlying function. */ expr = BASELINK_FUNCTIONS (expr); Index: decl2.c =================================================================== --- decl2.c (revision 180528) +++ decl2.c (working copy) @@ -4174,7 +4174,7 @@ mark_used (tree decl) like the DECL for the function. Otherwise, if the BASELINK is for an overloaded function, we don't know which function was actually used until after overload resolution. */ - if (TREE_CODE (decl) == BASELINK) + if (BASELINK_P (decl)) { decl = BASELINK_FUNCTIONS (decl); if (really_overloaded_fn (decl)) Index: name-lookup.c =================================================================== --- name-lookup.c (revision 180528) +++ name-lookup.c (working copy) @@ -5329,7 +5329,7 @@ arg_assoc (struct arg_lookup *k, tree n) n = TREE_OPERAND (n, 1); while (TREE_CODE (n) == TREE_LIST) n = TREE_VALUE (n); - if (TREE_CODE (n) == BASELINK) + if (BASELINK_P (n)) n = BASELINK_FUNCTIONS (n); if (TREE_CODE (n) == FUNCTION_DECL)