diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-24 00:01:44 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-24 00:01:44 +0000 |
commit | 74cfc2e4cb65a816ee50dc072fe2eab236310163 (patch) | |
tree | 4cb70d5d25eafaf22a09b592159852d8ae95b17f /gcc/go/gofrontend/statements.h | |
parent | 8e5be4b6a92d022f2ff37c18cf61f820c28ef3de (diff) | |
download | gcc-74cfc2e4cb65a816ee50dc072fe2eab236310163.tar.gz |
Change c <- v from an expression to a statement.
Don't do anything special if we don't use the value of <-c.
Fix sending an untyped constant in a select statement.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171371 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/go/gofrontend/statements.h')
-rw-r--r-- | gcc/go/gofrontend/statements.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/statements.h b/gcc/go/gofrontend/statements.h index 80cdffe801e..83d5436ac74 100644 --- a/gcc/go/gofrontend/statements.h +++ b/gcc/go/gofrontend/statements.h @@ -23,6 +23,7 @@ class For_statement; class For_range_statement; class Switch_statement; class Type_switch_statement; +class Send_statement; class Select_statement; class Variable; class Named_object; @@ -99,6 +100,7 @@ class Statement STATEMENT_UNNAMED_LABEL, STATEMENT_IF, STATEMENT_CONSTANT_SWITCH, + STATEMENT_SEND, STATEMENT_SELECT, // These statements types are created by the parser, but they @@ -236,6 +238,10 @@ class Statement static Type_switch_statement* make_type_switch_statement(Named_object* var, Expression*, source_location); + // Make a send statement. + static Send_statement* + make_send_statement(Expression* channel, Expression* val, source_location); + // Make a select statement. static Select_statement* make_select_statement(source_location); @@ -592,6 +598,44 @@ class Return_statement : public Statement Expression_list* vals_; }; +// A send statement. + +class Send_statement : public Statement +{ + public: + Send_statement(Expression* channel, Expression* val, + source_location location) + : Statement(STATEMENT_SEND, location), + channel_(channel), val_(val), for_select_(false) + { } + + // Note that this is for a select statement. + void + set_for_select() + { this->for_select_ = true; } + + protected: + int + do_traverse(Traverse* traverse); + + void + do_determine_types(); + + void + do_check_types(Gogo*); + + tree + do_get_tree(Translate_context*); + + private: + // The channel on which to send the value. + Expression* channel_; + // The value to send. + Expression* val_; + // Whether this is for a select statement. + bool for_select_; +}; + // Select_clauses holds the clauses of a select statement. This is // built by the parser. |