From patchwork Wed Jul 28 13:48:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 60143 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]) by ozlabs.org (Postfix) with SMTP id E51D3B6EFF for ; Wed, 28 Jul 2010 23:48:39 +1000 (EST) Received: (qmail 12394 invoked by alias); 28 Jul 2010 13:48:38 -0000 Received: (qmail 12384 invoked by uid 22791); 28 Jul 2010 13:48:35 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, TW_CC, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 28 Jul 2010 13:48:24 +0000 Received: from wpaz13.hot.corp.google.com (wpaz13.hot.corp.google.com [172.24.198.77]) by smtp-out.google.com with ESMTP id o6SDmMxu026709 for ; Wed, 28 Jul 2010 06:48:23 -0700 Received: from wwc33 (wwc33.prod.google.com [10.241.241.161]) by wpaz13.hot.corp.google.com with ESMTP id o6SDlLmq002576 for ; Wed, 28 Jul 2010 06:48:21 -0700 Received: by wwc33 with SMTP id 33so1050240wwc.12 for ; Wed, 28 Jul 2010 06:48:21 -0700 (PDT) Received: by 10.216.23.4 with SMTP id u4mr4392267weu.96.1280324901459; Wed, 28 Jul 2010 06:48:21 -0700 (PDT) Received: from coign.google.com (dhcp-172-28-249-136.lul.corp.google.com [172.28.249.136]) by mx.google.com with ESMTPS id v11sm3469251weq.16.2010.07.28.06.48.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 28 Jul 2010 06:48:20 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: [gccgo] Remove unused block parameter to Statement::make_temporary Date: Wed, 28 Jul 2010 06:48:18 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-System-Of-Record: true X-IsSubscribed: yes 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 The block parameter to Statement::make_temporary is no longer used since the old refcount code was removed. This patch removes the unused parameter. Committed to gccgo branch. Ian diff -r 8eb8fc09ef3c go/gogo.cc --- a/go/gogo.cc Wed Jul 28 06:44:17 2010 -0700 +++ b/go/gogo.cc Wed Jul 28 06:46:25 2010 -0700 @@ -1636,8 +1636,7 @@ Block* retblock = new Block(enclosing, loc); retblock->set_end_location(loc); - Temporary_statement* ts = Statement::make_temporary(retblock, - Type::make_boolean_type(), + Temporary_statement* ts = Statement::make_temporary(Type::make_boolean_type(), left, loc); retblock->add_statement(ts); @@ -1829,8 +1828,7 @@ break; source_location loc = (*pexpr)->location(); - Temporary_statement* ts = Statement::make_temporary(block, NULL, *pexpr, - loc); + Temporary_statement* ts = Statement::make_temporary(NULL, *pexpr, loc); block->insert_statement_before(*pindex, ts); ++*pindex; @@ -1872,8 +1870,7 @@ { Expression** pexpr = *p; source_location loc = (*pexpr)->location(); - Temporary_statement* ts = Statement::make_temporary(var->preinit_block(), - NULL, *pexpr, loc); + Temporary_statement* ts = Statement::make_temporary(NULL, *pexpr, loc); var->add_preinit_statement(ts); *pexpr = Expression::make_temporary_reference(ts, loc); } diff -r 8eb8fc09ef3c go/statements.cc --- a/go/statements.cc Wed Jul 28 06:44:17 2010 -0700 +++ b/go/statements.cc Wed Jul 28 06:46:25 2010 -0700 @@ -403,7 +403,7 @@ // Make and initialize a temporary variable in BLOCK. Temporary_statement* -Statement::make_temporary(Block* block, Type* type, Expression* init, +Statement::make_temporary(Type* type, Expression* init, source_location location) { return new Temporary_statement(type, init, location); @@ -571,8 +571,7 @@ if ((*pexpr)->must_eval_in_order()) { source_location loc = (*pexpr)->location(); - Temporary_statement* temp = Statement::make_temporary(this->block_, - NULL, *pexpr, loc); + Temporary_statement* temp = Statement::make_temporary(NULL, *pexpr, loc); this->block_->add_statement(temp); *pexpr = Expression::make_temporary_reference(temp, loc); } @@ -782,7 +781,7 @@ continue; } - Temporary_statement* temp = Statement::make_temporary(b, (*plhs)->type(), + Temporary_statement* temp = Statement::make_temporary((*plhs)->type(), *prhs, loc); b->add_statement(temp); temps.push_back(temp); @@ -894,17 +893,17 @@ // var key_temp KEY_TYPE = MAP_INDEX Temporary_statement* key_temp = - Statement::make_temporary(b, map_type->key_type(), map_index->index(), loc); + Statement::make_temporary(map_type->key_type(), map_index->index(), loc); b->add_statement(key_temp); // var val_temp VAL_TYPE Temporary_statement* val_temp = - Statement::make_temporary(b, map_type->val_type(), NULL, loc); + Statement::make_temporary(map_type->val_type(), NULL, loc); b->add_statement(val_temp); // var present_temp bool Temporary_statement* present_temp = - Statement::make_temporary(b, Type::lookup_bool_type(), NULL, loc); + Statement::make_temporary(Type::lookup_bool_type(), NULL, loc); b->add_statement(present_temp); // func mapaccess2(hmap map[k]v, key *k, val *v) bool @@ -1029,19 +1028,19 @@ // Evaluate the map first to get order of evaluation right. // map_temp := m // we are evaluating m[k] = v, p - Temporary_statement* map_temp = Statement::make_temporary(b, map_type, + Temporary_statement* map_temp = Statement::make_temporary(map_type, map_index->map(), loc); b->add_statement(map_temp); // var key_temp MAP_KEY_TYPE = k Temporary_statement* key_temp = - Statement::make_temporary(b, map_type->key_type(), map_index->index(), loc); + Statement::make_temporary(map_type->key_type(), map_index->index(), loc); b->add_statement(key_temp); // var val_temp MAP_VAL_TYPE = v Temporary_statement* val_temp = - Statement::make_temporary(b, map_type->val_type(), this->val_, loc); + Statement::make_temporary(map_type->val_type(), this->val_, loc); b->add_statement(val_temp); // func mapassign2(hmap map[k]v, key *k, val *v, p) @@ -1161,12 +1160,12 @@ // var val_temp ELEMENT_TYPE Temporary_statement* val_temp = - Statement::make_temporary(b, channel_type->element_type(), NULL, loc); + Statement::make_temporary(channel_type->element_type(), NULL, loc); b->add_statement(val_temp); // var success_temp bool Temporary_statement* success_temp = - Statement::make_temporary(b, Type::lookup_bool_type(), NULL, loc); + Statement::make_temporary(Type::lookup_bool_type(), NULL, loc); b->add_statement(success_temp); // func chanrecv2(c chan T, val *T) bool @@ -1397,7 +1396,7 @@ source_location loc = this->location(); // var val_temp TYPE - Temporary_statement* val_temp = Statement::make_temporary(b, this->type_, + Temporary_statement* val_temp = Statement::make_temporary(this->type_, NULL, loc); b->add_statement(val_temp); @@ -2767,7 +2766,7 @@ // Return a tree defining this label. tree -Label_statement::do_get_tree(Translate_context* context) +Label_statement::do_get_tree(Translate_context*) { return this->build_stmt_1(LABEL_EXPR, this->label_->get_decl()); } @@ -3455,7 +3454,7 @@ else { // var val_temp VAL_TYPE = VAL - val_temp = Statement::make_temporary(b, NULL, this->val_, loc); + val_temp = Statement::make_temporary(NULL, this->val_, loc); b->add_statement(val_temp); } @@ -3775,7 +3774,7 @@ // var descriptor_temp DESCRIPTOR_TYPE Type* descriptor_type = Type::make_type_descriptor_ptr_type(); Temporary_statement* descriptor_temp = - Statement::make_temporary(b, descriptor_type, NULL, loc); + Statement::make_temporary(descriptor_type, NULL, loc); b->add_statement(descriptor_temp); if (val_type->interface_type() == NULL) @@ -3897,7 +3896,7 @@ source_location loc = this->location_; // Evaluate the channel before the select statement. - Temporary_statement* channel_temp = Statement::make_temporary(b, NULL, + Temporary_statement* channel_temp = Statement::make_temporary(NULL, this->channel_, loc); b->add_statement(channel_temp); @@ -3908,7 +3907,7 @@ Temporary_statement* val_temp = NULL; if (this->is_send_) { - val_temp = Statement::make_temporary(b, NULL, this->val_, loc); + val_temp = Statement::make_temporary(NULL, this->val_, loc); b->add_statement(val_temp); } @@ -4472,20 +4471,18 @@ range_object = ve->named_object(); else { - range_temp = Statement::make_temporary(temp_block, NULL, this->range_, - loc); + range_temp = Statement::make_temporary(NULL, this->range_, loc); temp_block->add_statement(range_temp); } - Temporary_statement* index_temp = Statement::make_temporary(temp_block, - index_type, + Temporary_statement* index_temp = Statement::make_temporary(index_type, NULL, loc); temp_block->add_statement(index_temp); Temporary_statement* value_temp = NULL; if (this->value_var_ != NULL) { - value_temp = Statement::make_temporary(temp_block, value_type, NULL, loc); + value_temp = Statement::make_temporary(value_type, NULL, loc); temp_block->add_statement(value_temp); } @@ -4625,8 +4622,7 @@ Expression* ref = this->make_range_ref(range_object, range_temp, loc); Expression* len_call = this->call_builtin(gogo, "len", ref, loc); - Temporary_statement* len_temp = Statement::make_temporary(init, - index_temp->type(), + Temporary_statement* len_temp = Statement::make_temporary(index_temp->type(), len_call, loc); init->add_statement(len_temp); @@ -4715,7 +4711,7 @@ Block* init = new Block(enclosing, loc); Temporary_statement* next_index_temp = - Statement::make_temporary(init, index_temp->type(), NULL, loc); + Statement::make_temporary(index_temp->type(), NULL, loc); init->add_statement(next_index_temp); mpz_t zval; @@ -4900,8 +4896,7 @@ Type* map_iteration_type = Type::make_array_type(ptr_type, iexpr); Type* map_iteration_ptr = Type::make_pointer_type(map_iteration_type); - Temporary_statement* hiter = Statement::make_temporary(init, - map_iteration_type, + Temporary_statement* hiter = Statement::make_temporary(map_iteration_type, NULL, loc); init->add_statement(hiter); diff -r 8eb8fc09ef3c go/statements.h --- a/go/statements.h Wed Jul 28 06:44:17 2010 -0700 +++ b/go/statements.h Wed Jul 28 06:46:25 2010 -0700 @@ -134,7 +134,7 @@ // Either the type or the initialization expression may be NULL, but // not both. static Temporary_statement* - make_temporary(Block*, Type*, Expression*, source_location); + make_temporary(Type*, Expression*, source_location); // Make an assignment statement. static Statement*