diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-12-01 08:06:16 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-12-01 08:06:16 +0000 |
commit | 3e68d6d75a599806335a90b73b8c0e404c1fc021 (patch) | |
tree | 4be7e6271bd15650eafafeac4e96b4899f1d47d4 /gcc/go/gofrontend/expressions.cc | |
parent | 04f7a48eddb72c733d6ae586bcaace89773b3172 (diff) | |
download | gcc-3e68d6d75a599806335a90b73b8c0e404c1fc021.zip gcc-3e68d6d75a599806335a90b73b8c0e404c1fc021.tar.gz gcc-3e68d6d75a599806335a90b73b8c0e404c1fc021.tar.bz2 |
compiler/runtime: Copy channel implementation from master library.
From-SVN: r181874
Diffstat (limited to 'gcc/go/gofrontend/expressions.cc')
-rw-r--r-- | gcc/go/gofrontend/expressions.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index a2cf33e..a80c823 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -13493,12 +13493,18 @@ Receive_expression::do_check_types(Gogo*) tree Receive_expression::do_get_tree(Translate_context* context) { + Location loc = this->location(); + Channel_type* channel_type = this->channel_->type()->channel_type(); if (channel_type == NULL) { go_assert(this->channel_->type()->is_error()); return error_mark_node; } + + Expression* td = Expression::make_type_descriptor(channel_type, loc); + tree td_tree = td->get_tree(context); + Type* element_type = channel_type->element_type(); Btype* element_type_btype = element_type->get_backend(context->gogo()); tree element_type_tree = type_to_tree(element_type_btype); @@ -13507,8 +13513,7 @@ Receive_expression::do_get_tree(Translate_context* context) if (element_type_tree == error_mark_node || channel == error_mark_node) return error_mark_node; - return Gogo::receive_from_channel(element_type_tree, channel, - this->for_select_, this->location()); + return Gogo::receive_from_channel(element_type_tree, td_tree, channel, loc); } // Dump ast representation for a receive expression. |