From patchwork Fri Apr 27 11:54:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 905666 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-476900-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="UnVkcgDb"; 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 40XXRn2jHLz9s02 for ; Fri, 27 Apr 2018 21:54:55 +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=wfJbEWWzWJFDYcmG5A1VWSecnekDWdQ1rOvNegvESexAkSIi1v hjb3WSYd9mktrs76Nh78sj2W2ANcdXqxeqwAUs2xEJDK1Pd4dm9uCYbQjV/BzNaq AzBtthft8XIe7766mp0kDbQ/nJpNtVTN3iH2JnyY/5jTYMRZCNwCyeZdU= 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=gJ/ccQL0TwsalBI+v07GqtF6nag=; b=UnVkcgDb33bN3VffSbz5 3EcFc4sAgXJezrAmEkXTJ7Mo5MDhmrLZFP1S0/2UAN7HZvOV3l9qrHjjJSpuZ7vE S0ZIXqCnUDt8Gi75lhdN4RHB8BVvKOa6IrbGSyC0hkOu78A8rZbpkW/gcFxjU4I+ /aPNDXpZAXZLTUctHUeTKeY= Received: (qmail 108075 invoked by alias); 27 Apr 2018 11:54: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 108062 invoked by uid 89); 27 Apr 2018 11:54:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Below, tmpl, UD:pt.c, pt.c X-HELO: mail-qt0-f171.google.com Received: from mail-qt0-f171.google.com (HELO mail-qt0-f171.google.com) (209.85.216.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Apr 2018 11:54:43 +0000 Received: by mail-qt0-f171.google.com with SMTP id z23-v6so1833002qti.5 for ; Fri, 27 Apr 2018 04:54:42 -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=aBPQMHAta0gYFSF4PIfJIPxj1l+SdJDFryIEBaKX+qk=; b=uYuFMs0wVjhXqoBkR00fCNisQNRGz/kCi/16zp1Zejmd34EH+AKcqJ8jt4o9opGOGh QIWfVRUPm2r8FBqdFfdPNoJlaxXs6ZvJSKyQ4jKABLo2lROf5UyGdEAEMh2Hhtcbujg0 GG3JTn9PNCyKrbDZAtEBKPl29b80LIUds8YN5698aaxKoyidqfdC5gDHtu0/c9OOTXsI Vi8BqpTywFR8M32WK0GXEFLyDa03rh+5sWEjmzSrck8+cdCHUL00mVcXl/pUZsc1x+t0 bAu440wtkIREU5iRVzLe1HIuH885i+LSU2ApCPHKl1L9Fh+or6PsSQNF87sWzdabhb0U hkuQ== X-Gm-Message-State: ALQs6tA+tAJFmvN5seS1J1AMit/pHsdGJwlef7zsGIDdaCINHo8F4YQ5 zGwqp//sY3pp3mGYTa9vP74= X-Google-Smtp-Source: AB8JxZqQmCSRK6kFXEtqRGKyD8VLCR7CtARmGP5e8PcWnihjxwlNpMw3NCZ58GbrSRU5KjJw9ju9fQ== X-Received: by 2002:a0c:92af:: with SMTP id b44-v6mr1632205qvb.169.1524830081362; Fri, 27 Apr 2018 04:54:41 -0700 (PDT) Received: from ?IPv6:2601:181:c480:b5c0::93f8? ([2601:181:c480:b5c0::93f8]) by smtp.googlemail.com with ESMTPSA id v56-v6sm848278qtc.96.2018.04.27.04.54.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Apr 2018 04:54:40 -0700 (PDT) To: GCC Patches From: Nathan Sidwell Subject: [C++ PATCH] some cleanups Message-ID: <26790225-32ae-4917-5923-b17c12ecadba@acm.org> Date: Fri, 27 Apr 2018 07:54:39 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 A few cleanups from the modules branch. * The TEMPLATE_INFO comments still described TREE_LIST contents. * we didn't check we were looking at a TEMPLATE_INFO in one case * we declared some (now?) non-existent dump functions * we made a name-lookup internal dumping function extern * we made a template (now?) internal creator function extern committing to trunk. nathan 2018-04-27 Nathan Sidwell * cp-tree.h (TEMPLATE_INFO): Fix comments. (TI_PENDING_TEMPLATE_FLAG): Check TEMPLATE_INFO. (NON_DEFAULT_TEMPLATE_ARG_COUNT): Wrap line. (dump, print_other_binding_stacks): Remove declarations. * name-lookup.c (print_other_binding_stack): Make static. * pt.c (build_template_decl): Make static. Index: cp-tree.h =================================================================== --- cp-tree.h (revision 259683) +++ cp-tree.h (working copy) @@ -3273,11 +3273,11 @@ extern void decl_shadowed_for_var_insert DECL_USE_TEMPLATE is nonzero) or the abstract instance of the template itself. - In either case, DECL_TEMPLATE_INFO is a TREE_LIST, whose - TREE_PURPOSE is the TEMPLATE_DECL of which this entity is a - specialization or abstract instance. The TREE_VALUE is the + In either case, DECL_TEMPLATE_INFO is a TEMPLATE_INFO, whose + TI_TEMPLATE is the TEMPLATE_DECL of which this entity is a + specialization or abstract instance. The TI_ARGS is the template arguments used to specialize the template. - + Consider: template struct S { friend void f(T) {} }; @@ -3344,11 +3344,14 @@ extern void decl_shadowed_for_var_insert #define TI_TEMPLATE(NODE) TREE_TYPE (TEMPLATE_INFO_CHECK (NODE)) #define TI_ARGS(NODE) TREE_CHAIN (TEMPLATE_INFO_CHECK (NODE)) -#define TI_PENDING_TEMPLATE_FLAG(NODE) TREE_LANG_FLAG_1 (NODE) +#define TI_PENDING_TEMPLATE_FLAG(NODE) \ + TREE_LANG_FLAG_1 (TEMPLATE_INFO_CHECK (NODE)) /* For a given TREE_VEC containing a template argument list, this property contains the number of arguments that are not defaulted. */ -#define NON_DEFAULT_TEMPLATE_ARGS_COUNT(NODE) TREE_CHAIN (TREE_VEC_CHECK (NODE)) +#define NON_DEFAULT_TEMPLATE_ARGS_COUNT(NODE) \ + TREE_CHAIN (TREE_VEC_CHECK (NODE)) + /* Below are the setter and getter of the NON_DEFAULT_TEMPLATE_ARGS_COUNT property. */ #define SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT(NODE, INT_VALUE) \ @@ -6229,9 +6232,6 @@ extern tree strip_fnptr_conv (tree); extern void maybe_push_cleanup_level (tree); extern tree make_anon_name (void); extern tree check_for_out_of_scope_variable (tree); -extern void dump (cp_binding_level &ref); -extern void dump (cp_binding_level *ptr); -extern void print_other_binding_stack (cp_binding_level *); extern tree maybe_push_decl (tree); extern tree current_decl_namespace (void); Index: name-lookup.c =================================================================== --- name-lookup.c (revision 259683) +++ name-lookup.c (working copy) @@ -3742,7 +3742,7 @@ debug (cp_binding_level *ptr) } -void +static void print_other_binding_stack (cp_binding_level *stack) { cp_binding_level *level; Index: pt.c =================================================================== --- pt.c (revision 259683) +++ pt.c (working copy) @@ -4674,7 +4674,7 @@ maybe_update_decl_type (tree orig_type, template PARMS and constraints, CONSTR. If MEMBER_TEMPLATE_P is true, the new template is a member template. */ -tree +static tree build_template_decl (tree decl, tree parms, bool member_template_p) { tree tmpl = build_lang_decl (TEMPLATE_DECL, DECL_NAME (decl), NULL_TREE);