From patchwork Mon Oct 23 01:46:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 156631 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1025836vqx; Sun, 22 Oct 2023 18:47:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQaaYdhheZcgqg3EYBgkxxaPhZDiv83LH2Tj9Ofswujb+nn4DHWfeEv6ZOK8IWg/pab+qc X-Received: by 2002:ac8:5c08:0:b0:418:d3d:30e1 with SMTP id i8-20020ac85c08000000b004180d3d30e1mr9528808qti.4.1698025621934; Sun, 22 Oct 2023 18:47:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698025621; cv=pass; d=google.com; s=arc-20160816; b=GQU1BsNnD+GGPx1ztyMqWDbhyEWghrbsVIg+Esu1M2xdoR+PTDn1F/dd/MJNHYMeuH H5Z6oFNE0eHyVOy0Y5QrtnZ1yz+c+brwCtOUWka58/XOXC6+EVRQLPkjpcG0u7YW3Et4 DtqWOP/Z0l+/Mduxyd2k8yo1amYpo98U6NT4AehyH+PaVDqp268eITpGG1+GmIM1al5f x+n9fSSjxlsn8cJ11yx6MhQRrs8RwicVz9BqiPyQjhPu6QYlQuxCQLlFNVEGtVUasNUq V6PW5XWIW7NXECAquvtTY8jZ7Lgzc4EgplFpZqasAAuZqpAzv9k+Gm0ePtGSsCFRDav9 UjTw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:to:subject:message-id:date:from :mime-version:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=8UUoOMxyAC6ahMlZMsfQNo6EVsjrB5ggtQZoUY8geXU=; fh=sx1AF6BoRLLvWrm7PiL2RBt/kekZxFGoFwZKL1Ho560=; b=ClkmmRl84bFxGX3fQVJufgX7PNmxEV9ZW1vazRIB1xVvlBw7BDVxz9O7bOt/AWmgb0 u34vf5zhs/9be0C9bDfRKm6MLhwC6mS6d4UE5xdv4E/zXVJ6DYs+JDOtELoaBtZEqX8B z86OLCTxR9RijFN8uXoDvnmhJjFt1ceK9J/MnMrdc6D10uQ2aV7C/2CvkMvKRe4cWl2D iVcYC/1ssYSvNe8+4whDjk97QnqK4T/eLclK/yQ0CwYDN153gjbj0GXENFuxUabeZYIe d1BfR9XfGRIdq/xn1sa1k2qwPAq9l+PkwI6pC4VoZtpcGze2m6DONOxahSoXHy5IlhUj arww== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@golang-org.20230601.gappssmtp.com header.s=20230601 header.b=Sqe6ST8o; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=golang.org Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id u37-20020a05622a19a500b0041986eba0c3si4777229qtc.350.2023.10.22.18.47.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 18:47:01 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@golang-org.20230601.gappssmtp.com header.s=20230601 header.b=Sqe6ST8o; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=golang.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AFAD23858298 for ; Mon, 23 Oct 2023 01:47:01 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by sourceware.org (Postfix) with ESMTPS id B9C293858D39 for ; Mon, 23 Oct 2023 01:46:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B9C293858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=golang.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=golang.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B9C293858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::b34 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698025598; cv=none; b=ZUHB3Zga6PtuqLcuMv1IVzxf5f01nW8GFrSHLPQdgXlfljn2A8yHlF0zsbqp0z35UZBOzrTp017nrOzbaTsykGsGGefYJQREWVxsf6ncFdFKK4nLM0f1klcbwrebzukyg3PtlIqUZxuTyFRIMZar/yZZYXi+0E1HrN15vlKgVtU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698025598; c=relaxed/simple; bh=zbZAT9pgIGyIrA+pglzBKDhrdJ1TAEiKozIDqouzcUY=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=FgcRpqwgGRmURjWPChBLRPHf31WBcmLeMik4EVIgos1XfIZz4lGL+Bo+U//e2mOSt+x16eApJNxAfH5RPgT0FuY/bxmd3HnBNv7jvyYBpCnO1Y1BBQE81Gehd9CRM0dAIcClWeF1JpBB3k4S20A0F1rLmqOK1thGWoQq/hi0Pe4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yb1-xb34.google.com with SMTP id 3f1490d57ef6-d9c7bba32beso2717972276.1 for ; Sun, 22 Oct 2023 18:46:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golang-org.20230601.gappssmtp.com; s=20230601; t=1698025595; x=1698630395; darn=gcc.gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=8UUoOMxyAC6ahMlZMsfQNo6EVsjrB5ggtQZoUY8geXU=; b=Sqe6ST8ouCgm1k5d8lTgvyUv2Nrmapg5amw6K0YDKqyvnxAlDMp+iPITFNYkpDm9sV ObYe5HxYF/C+chEFPzalIWOAyzcNc5CvDyxkWFO4IUA5hVXCUDTpttXrY5Y6LpTa4Ypy 95jN7EgQ4/iNRlTiLNoX1f90ch29TPlf/SXQRUokOB16MDHOuGghIMbADza/wnHRUo9B ubGh+NWyDwgU48iZXlaGZpzrmrIpH6UPPIMJeTLSjk3R6KiZVfsmCOyeZ/UDRLlORwg7 NOFOYUWnZXWAX4lXU138xVkQ/rbLXeDxBiFH+5zFry1NugZX/GZ7DIgjJ3OT7wSwQyEY S2pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698025595; x=1698630395; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=8UUoOMxyAC6ahMlZMsfQNo6EVsjrB5ggtQZoUY8geXU=; b=OhsRfFd04Cnm7gM5vQScKF4H00bikcN2GGJnByipu01yHrxp9DrfxI+Gws3XbCJltw TZne5tNfBIlKnAg9vZtHW3Zm3/idbioOiWWsXNX32kqYhVQUWbGUJsbaejSgcii39wwD JzbITpzCyEwZZA1TAGOdJveyhROEBHf6OA1yOFBvOlmpFBs2tYRamwozGwJclC3EiUEV nrFH99Am4D2B8PbywBadMeLfhAUWBRZPM4/QhzT80XeXsXAEreK5xYxko9xauPqjjylL aWCOoaf1njdgNlPzDtT+dfPYPtGGoPnremzfP48E26z7xnoGzQHCCN4t3g9IhbQu3Lrk uYug== X-Gm-Message-State: AOJu0YxKvm+KBX3LPY1CEx/LfWy0Mq34MDzXgjCWPmpByUQI0GGcSzYY q+VSvezwd2RLTpe2/0eh7uix6XbYNHoUCw49uGAiW1kzzcwnL9AJhlY= X-Received: by 2002:a25:428d:0:b0:d9a:c218:817c with SMTP id p135-20020a25428d000000b00d9ac218817cmr8410631yba.4.1698025594734; Sun, 22 Oct 2023 18:46:34 -0700 (PDT) MIME-Version: 1.0 From: Ian Lance Taylor Date: Sun, 22 Oct 2023 18:46:23 -0700 Message-ID: Subject: Go patch committed: Remove name_ field from Type_switch_statement To: gcc-patches , gofrontend-dev X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780508914514018222 X-GMAIL-MSGID: 1780508914514018222 This patch to the Go frontend removes the name_ field from the Type_switch_statement class. It's not used for anything. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian 1a1fba1e25779247a4969789885ce80b7b4a2359 diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 28683d6852b..d31fb336e41 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -06ada1f2ab9b05e54641438db28c557c6900b2a3 +75b08794cb1485c955d13784c53a89174764af55 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc index c93d82bba39..d7410588347 100644 --- a/gcc/go/gofrontend/parse.cc +++ b/gcc/go/gofrontend/parse.cc @@ -4932,7 +4932,7 @@ Parse::type_switch_body(Label* label, const Type_switch& type_switch, } Type_switch_statement* statement = - Statement::make_type_switch_statement(var_name, init, location); + Statement::make_type_switch_statement(init, location); this->push_break_statement(statement, label); Type_case_clauses* case_clauses = new Type_case_clauses(); diff --git a/gcc/go/gofrontend/statements.cc b/gcc/go/gofrontend/statements.cc index 33b568e3eeb..b43f1393e33 100644 --- a/gcc/go/gofrontend/statements.cc +++ b/gcc/go/gofrontend/statements.cc @@ -5046,8 +5046,6 @@ Type_switch_statement::do_dump_statement(Ast_dump_context* ast_dump_context) { ast_dump_context->print_indent(); ast_dump_context->ostream() << "switch "; - if (!this->name_.empty()) - ast_dump_context->ostream() << this->name_ << " = "; ast_dump_context->dump_expression(this->expr_); ast_dump_context->ostream() << " .(type)"; if (ast_dump_context->dump_subblocks()) @@ -5062,10 +5060,9 @@ Type_switch_statement::do_dump_statement(Ast_dump_context* ast_dump_context) // Make a type switch statement. Type_switch_statement* -Statement::make_type_switch_statement(const std::string& name, Expression* expr, - Location location) +Statement::make_type_switch_statement(Expression* expr, Location location) { - return new Type_switch_statement(name, expr, location); + return new Type_switch_statement(expr, location); } // Class Send_statement. diff --git a/gcc/go/gofrontend/statements.h b/gcc/go/gofrontend/statements.h index eb795c4b920..9ef63cb9a61 100644 --- a/gcc/go/gofrontend/statements.h +++ b/gcc/go/gofrontend/statements.h @@ -253,7 +253,7 @@ class Statement // Make a type switch statement. static Type_switch_statement* - make_type_switch_statement(const std::string&, Expression*, Location); + make_type_switch_statement(Expression*, Location); // Make a send statement. static Send_statement* @@ -2191,10 +2191,9 @@ class Type_case_clauses class Type_switch_statement : public Statement { public: - Type_switch_statement(const std::string& name, Expression* expr, - Location location) + Type_switch_statement(Expression* expr, Location location) : Statement(STATEMENT_TYPE_SWITCH, location), - name_(name), expr_(expr), clauses_(NULL), break_label_(NULL) + expr_(expr), clauses_(NULL), break_label_(NULL) { } // Add the clauses. @@ -2227,10 +2226,7 @@ class Type_switch_statement : public Statement do_may_fall_through() const; private: - // The name of the variable declared in the type switch guard. Empty if there - // is no variable declared. - std::string name_; - // The expression we are switching on if there is no variable. + // The expression we are switching on. Expression* expr_; // The type case clauses. Type_case_clauses* clauses_;