diff options
Diffstat (limited to 'gcc/go')
-rw-r--r-- | gcc/go/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/go/Make-lang.in | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/statements.cc | 24 |
3 files changed, 25 insertions, 5 deletions
diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog index 3802fa8e463..2eaf210c94f 100644 --- a/gcc/go/ChangeLog +++ b/gcc/go/ChangeLog @@ -1,3 +1,7 @@ +2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * Make-lang.in (gospec.o): Pass SHLIB instead of SHLIB_LINK. + 2011-08-24 Roberto Lublinerman <rluble@gmail.com> * lang.opt: Add fgo-optimize-. diff --git a/gcc/go/Make-lang.in b/gcc/go/Make-lang.in index d7ae7aee6fb..62a4d6f0dee 100644 --- a/gcc/go/Make-lang.in +++ b/gcc/go/Make-lang.in @@ -32,7 +32,7 @@ go: go1$(exeext) gospec.o: $(srcdir)/go/gospec.c $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) \ $(CONFIG_H) opts.h - (SHLIB_LINK='$(SHLIB_LINK)'; \ + (SHLIB='$(SHLIB)'; \ $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \ $(INCLUDES) $(srcdir)/go/gospec.c) diff --git a/gcc/go/gofrontend/statements.cc b/gcc/go/gofrontend/statements.cc index abc629e12c3..156977d3f5d 100644 --- a/gcc/go/gofrontend/statements.cc +++ b/gcc/go/gofrontend/statements.cc @@ -4559,10 +4559,26 @@ Select_clauses::Select_clause::lower(Gogo* gogo, Named_object* function, loc); Statement* s = Statement::make_tuple_receive_assignment(val, closed, ref, true, loc); + // We have to put S in STATEMENTS_, because that is where the // variables are declared. + go_assert(this->statements_ != NULL); - this->statements_->add_statement_at_front(s); + + // Skip the variable declaration statements themselves. + size_t skip = 1; + if (this->var_ != NULL) + skip = 2; + + // Verify that we are only skipping variable declarations. + size_t i = 0; + for (Block::iterator p = this->statements_->begin(); + i < skip && p != this->statements_->end(); + ++p, ++i) + go_assert((*p)->variable_declaration_statement() != NULL); + + this->statements_->insert_statement_before(skip, s); + // We have to lower STATEMENTS_ again, to lower the tuple // receive assignment we just added. gogo->lower_block(function, this->statements_); @@ -4655,7 +4671,8 @@ Select_clauses::Select_clause::dump_clause( { ast_dump_context->dump_expression(this->channel_); ast_dump_context->ostream() << " <- " ; - ast_dump_context->dump_expression(this->val_); + if (this->val_ != NULL) + ast_dump_context->dump_expression(this->val_); } else { @@ -4667,8 +4684,7 @@ Select_clauses::Select_clause::dump_clause( ast_dump_context->ostream() << " , " ; ast_dump_context->dump_expression(this->closed_); } - if (this->closedvar_ != NULL || - this->var_ != NULL) + if (this->closedvar_ != NULL || this->var_ != NULL) ast_dump_context->ostream() << " := " ; ast_dump_context->ostream() << " <- " ; |