From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2116) id 4A9DC3858D39; Mon, 23 Oct 2023 01:46:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4A9DC3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698025582; bh=h8z6mdF33JJSrx80JC9oes7CP3kd7E6o9CPLHg++vtU=; h=From:To:Subject:Date:From; b=JPE0tJ0CLCV3d+FC9oqzCNtzaSWSTRXKtRzpoZVykMjxHB8atT9pmJPdh2qmbjS6+ KJsFjmhL16OMwxMr9s9TT/lKXyS9X2w8eopggy10UbCC6IBwLDrDkMQl9I4Oj3xNjQ kZqwQ6z7zSwQ/131z43FZiavRd9V16Wg8Z2cAdXw= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Ian Lance Taylor To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-4838] compiler: remove name_ field from Type_switch_statement X-Act-Checkin: gcc X-Git-Author: Ian Lance Taylor X-Git-Refname: refs/heads/master X-Git-Oldrev: b513aa235d6e5d7e2a36ee789c60891fce873340 X-Git-Newrev: 1a1fba1e25779247a4969789885ce80b7b4a2359 Message-Id: <20231023014622.4A9DC3858D39@sourceware.org> Date: Mon, 23 Oct 2023 01:46:22 +0000 (GMT) List-Id: https://gcc.gnu.org/g:1a1fba1e25779247a4969789885ce80b7b4a2359 commit r14-4838-g1a1fba1e25779247a4969789885ce80b7b4a2359 Author: Ian Lance Taylor Date: Thu Sep 28 22:33:32 2023 -0700 compiler: remove name_ field from Type_switch_statement It's not used for anything. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/536636 Diff: --- gcc/go/gofrontend/MERGE | 2 +- gcc/go/gofrontend/parse.cc | 2 +- gcc/go/gofrontend/statements.cc | 7 ++----- gcc/go/gofrontend/statements.h | 12 ++++-------- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 28683d6852bc..d31fb336e413 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 c93d82bba395..d7410588347b 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 33b568e3eeb9..b43f1393e339 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 eb795c4b9207..9ef63cb9a61b 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_;