From patchwork Wed Sep 23 15:15:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 1369902 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=koGmoAD0; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BxMDx4mr1z9ryj for ; Thu, 24 Sep 2020 01:15:28 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7E2FA394D8BE; Wed, 23 Sep 2020 15:15:26 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by sourceware.org (Postfix) with ESMTPS id 819CD394D82B for ; Wed, 23 Sep 2020 15:15:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 819CD394D82B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nathanmsidwell@gmail.com Received: by mail-qt1-x82f.google.com with SMTP id z2so104798qtv.12 for ; Wed, 23 Sep 2020 08:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=4X6pVf7gnTyiYJH6Q3E0t3YaTSelnnuteTwT1Vxkfc8=; b=koGmoAD0s40Dmhd+wQM5yjjJElUfiU5H4Jby/9qNhRoOPYTSeWmbPv99QH8PsboZ/Y ENHyEoD6Y0imBcbxYIDs8lOLS+CfluDN5HJVVjHx2/pkrs/z4DwIexE6VjbtCMELJKkA jNwn7y/QGatwV48IjPxrjlelLJld9AS0QvR8RRLLyhr5pT1kIxoN+q2AbEf2dPwdYpVb x21GAKPyROt+ikFISLGLgWtVsSNggQ4dNMkBahDE3NrLzD0vH5S1qKGFo1BEQ7e/8dnL 5sojLMSST6OMdLFZeXhobtZ45ozIqAGC0HHM3ZUqbCmujfuoYB8L/ARFz1uWcMBVJznE r8KA== 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=4X6pVf7gnTyiYJH6Q3E0t3YaTSelnnuteTwT1Vxkfc8=; b=LnFSQ5Ecg2aeFlC5Dy41UTZ2n5In+oybhCgheuOJNl2a8YDia/Bc6g/bFMGrvxD/bC SGmVnDZKhKdq7eCJQsJrT0Kxk+utuwDrsLIzSRhz8IbGpjTi5M95sjmhreNfrto09VSv NzJAUrBqqbiLUWA20nY4NPUxcxZv8Xp8xfZ5JfRblg/uLV3l4kJeduLMPTmSr0lh0K01 mPW45h0R5mcvXKStvEVOJCUzFGuCeMe+PedLaj1WYVXgU99EEPCuVjtLGhzvAfkoji6a lOdhAprYselFAsVuVobrSoUFsw7nevWIq67Pgtyq08BOzieV1mmhmUafEpdjzZNbSQG+ qCxw== X-Gm-Message-State: AOAM532LJTiFtCdaC8V7Nj/Jm7UIpDH24wKgfab69yvNUXjvOShrGQce MXMj3C4iULKALqtiCTYWxtg= X-Google-Smtp-Source: ABdhPJwoKlEPTomOfN+Xje0AnQvOdPLhdyeCEPf8EQdmIYzWN3YvV/QSDtjzVusJ3eAoqaX03vGhVg== X-Received: by 2002:ac8:1626:: with SMTP id p35mr513662qtj.326.1600874123489; Wed, 23 Sep 2020 08:15:23 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a8:1102:7d99:242a:d3d0:21c8? ([2620:10d:c091:480::1:22be]) by smtp.googlemail.com with ESMTPSA id y20sm166350qkj.70.2020.09.23.08.15.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Sep 2020 08:15:22 -0700 (PDT) To: GCC Patches From: Nathan Sidwell Subject: c++: Remove some gratuitous typedefing Message-ID: <8fd54f04-72e8-eace-b51c-38e8484cf397@acm.org> Date: Wed, 23 Sep 2020 11:15:21 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 Content-Language: en-US X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" This is C++, we don't need 'typedef struct foo foo;'. Oh, and bool bitfields are a thing. gcc/cp/ * name-lookup.h (typedef cxx_binding): Delete tdef. (typedef cp_binding_level): Likewise. (struct cxx_binding): Flags are bools. pushing to trunk nathan diff --git i/gcc/cp/name-lookup.h w/gcc/cp/name-lookup.h index a0815e1a0ac..5d2d364fc3a 100644 --- i/gcc/cp/name-lookup.h +++ w/gcc/cp/name-lookup.h @@ -47,12 +47,8 @@ struct GTY(()) binding_entry_s { extern void binding_table_foreach (binding_table, bt_foreach_proc, void *); extern binding_entry binding_table_find (binding_table, tree); -/* Datatype that represents binding established by a declaration between - a name and a C++ entity. */ -typedef struct cxx_binding cxx_binding; - /* The datatype used to implement C++ scope. */ -typedef struct cp_binding_level cp_binding_level; +struct cp_binding_level; /* Nonzero if this binding is for a local scope, as opposed to a class or namespace scope. */ @@ -62,6 +58,8 @@ typedef struct cp_binding_level cp_binding_level; currently being defined. */ #define INHERITED_VALUE_BINDING_P(NODE) ((NODE)->value_is_inherited) +/* Datatype that represents binding established by a declaration between + a name and a C++ entity. */ struct GTY(()) cxx_binding { /* Link to chain together various bindings for this name. */ cxx_binding *previous; @@ -71,8 +69,9 @@ struct GTY(()) cxx_binding { tree type; /* The scope at which this binding was made. */ cp_binding_level *scope; - unsigned value_is_inherited : 1; - unsigned is_local : 1; + + bool value_is_inherited : 1; + bool is_local : 1; }; /* Datatype used to temporarily save C++ bindings (for implicit