From patchwork Fri May 5 15:07:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 759056 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wKFd519X3z9s7n for ; Sat, 6 May 2017 01:07:52 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="h8Ayj3EZ"; dkim-atps=neutral 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=CAs+ZcAVUdwBjkPondueeITGau6IV9q0TPeALAkEoKWq6CimGn PIOiIvyJK1Y06AtDdkkaTLOY3xdpADTXYlfM1HoSZdrh5xdXCwteOC0SQQP+Yr26 VPfm9RW94LSAas4DOcaZsmIT/JDqIearMs260gKvRvKGOay3fAKVLUZHo= 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=e9PoWkNlb/RAiDd5eBESyhIo66E=; b=h8Ayj3EZbbPzvgXdvOmc 8ZNEtGBQ7Laf9EV1REtMAHErxHUMTf+5ZsiUwS9/jnzstDda181OwnsHpwKXaNF/ gGdiZXgZ/hPgPo+WgFOZqicJsqVr8uV4cwQBb/ofzuBouLVhbSuzVsmuS8D/Y47S BzklbGXZz+sbL+9ITJjdg6I= Received: (qmail 45304 invoked by alias); 5 May 2017 15:07:42 -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 45286 invoked by uid 89); 5 May 2017 15:07:41 -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= 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; Fri, 05 May 2017 15:07:39 +0000 Received: by mail-yw0-f175.google.com with SMTP id 203so4225821ywe.0 for ; Fri, 05 May 2017 08:07: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=ksuITFfff9or4AakfKA6jQVIy4eQ1KuwLgZ2KbilBJo=; b=owq5KwWBY++2D8yFa6exEmG6p/vtodFAz2UUG5V5OcS624GeDzovyPhFUlSaBikDBr +RFK7+lHRbuhh1Wollub44uYYF5ylUqVZSZNGospnQk42ipZK6YDRmciCFyOobH5EJUp P7d+m0IRiAL5v+LZ8HfifZGs7lwrpnWkdrAGmmHuSR6B3YDZ7ISPv3VxLHi9vt9FUtWb +RN2tVU65ZxXj+k6XoOJfXQ5ZJ7hvKgITihkzYEyFOQZoxiDiDwiVihEyEy0uhJrku5+ fKDUv5UgXYUqB4ZLuYClTARclADopRt68GYhV8F4i4wd5Cq9dmhPJT3A7nx87affLmMo O+Fg== X-Gm-Message-State: AN3rC/6j/HYmGk7BU94SR2A9t3fW4vn2Jk1CQLxJcgbq0Wwp3nUi4l0O Wn5dfx6rrcIC3Q== X-Received: by 10.129.163.131 with SMTP id a125mr20599763ywh.115.1493996860718; Fri, 05 May 2017 08:07:40 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a3:20fb:f6d0:5ac5:64cd:f102? ([2620:10d:c091:200::2:16e0]) by smtp.googlemail.com with ESMTPSA id p6sm2408429ywc.23.2017.05.05.08.07.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 May 2017 08:07:40 -0700 (PDT) To: GCC Patches From: Nathan Sidwell Subject: [C++ PATCH] kill namespace walking Message-ID: Date: Fri, 5 May 2017 11:07:38 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 And with static_decls no longer being namespace-specific, we can kill the namespace walker function. (the spelling suggester doesn't use it, and my to-be-committed reworking will allow that to be improved) nathan 2017-05-05 Nathan Sidwell Kill walk_namespaces. * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete. * decl.c (walk_namespaces_r, walk_namespaces): Delete. Index: cp-tree.h =================================================================== --- cp-tree.h (revision 247636) +++ cp-tree.h (working copy) @@ -5902,9 +5902,6 @@ extern void revert_static_member_fn (tr extern void fixup_anonymous_aggr (tree); extern tree compute_array_index_type (tree, tree, tsubst_flags_t); extern tree check_default_argument (tree, tree, tsubst_flags_t); -typedef int (*walk_namespaces_fn) (tree, void *); -extern int walk_namespaces (walk_namespaces_fn, - void *); extern int wrapup_namespace_globals (); extern tree create_implicit_typedef (tree, tree); extern int local_variable_p (const_tree); Index: decl.c =================================================================== --- decl.c (revision 247636) +++ decl.c (working copy) @@ -78,7 +78,6 @@ static void check_for_uninitialized_cons static tree local_variable_p_walkfn (tree *, int *, void *); static const char *tag_name (enum tag_types); static tree lookup_and_check_tag (enum tag_types, tree, tag_scope, bool); -static int walk_namespaces_r (tree, walk_namespaces_fn, void *); static void maybe_deduce_size_from_array_init (tree, tree); static void layout_var_decl (tree); static tree check_initializer (tree, tree, int, vec **); @@ -879,32 +878,6 @@ poplevel (int keep, int reverse, int fun return block; } -/* Walk all the namespaces contained NAMESPACE, including NAMESPACE - itself, calling F for each. The DATA is passed to F as well. */ - -static int -walk_namespaces_r (tree name_space, walk_namespaces_fn f, void* data) -{ - int result = 0; - tree current = NAMESPACE_LEVEL (name_space)->namespaces; - - result |= (*f) (name_space, data); - - for (; current; current = DECL_CHAIN (current)) - result |= walk_namespaces_r (current, f, data); - - return result; -} - -/* Walk all the namespaces, calling F for each. The DATA is passed to - F as well. */ - -int -walk_namespaces (walk_namespaces_fn f, void* data) -{ - return walk_namespaces_r (global_namespace, f, data); -} - /* Call wrapup_globals_declarations for the globals in NAMESPACE. */ /* Diagnose odr-used extern inline variables without definitions in the current TU. */