diff options
Diffstat (limited to 'gcc/go/gofrontend/statements.h')
-rw-r--r-- | gcc/go/gofrontend/statements.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/statements.h b/gcc/go/gofrontend/statements.h index c5995710792..ee5be875aa0 100644 --- a/gcc/go/gofrontend/statements.h +++ b/gcc/go/gofrontend/statements.h @@ -894,8 +894,7 @@ class Select_statement : public Statement { this->clauses_->check_types(); } bool - do_may_fall_through() const - { return this->clauses_->may_fall_through(); } + do_may_fall_through() const; Bstatement* do_get_backend(Translate_context*); @@ -1086,6 +1085,9 @@ class For_statement : public Statement Statement* do_lower(Gogo*, Named_object*, Block*, Statement_inserter*); + bool + do_may_fall_through() const; + Bstatement* do_get_backend(Translate_context*) { go_unreachable(); } @@ -1399,6 +1401,9 @@ class Switch_statement : public Statement void do_dump_statement(Ast_dump_context*) const; + bool + do_may_fall_through() const; + private: // The value to switch on. This may be NULL. Expression* val_; @@ -1449,6 +1454,11 @@ class Type_case_clauses lower(Type*, Block*, Temporary_statement* descriptor_temp, Unnamed_label* break_label) const; + // Return true if these clauses may fall through to the statements + // following the switch statement. + bool + may_fall_through() const; + // Dump the AST representation to a dump context. void dump_clauses(Ast_dump_context*) const; @@ -1493,6 +1503,12 @@ class Type_case_clauses lower(Type*, Block*, Temporary_statement* descriptor_temp, Unnamed_label* break_label, Unnamed_label** stmts_label) const; + // Return true if this clause may fall through to execute the + // statements following the switch statement. This is not the + // same as whether this clause falls through to the next clause. + bool + may_fall_through() const; + // Dump the AST representation to a dump context. void dump_clause(Ast_dump_context*) const; @@ -1556,6 +1572,9 @@ class Type_switch_statement : public Statement void do_dump_statement(Ast_dump_context*) const; + bool + do_may_fall_through() const; + private: // The variable holding the value we are switching on. Named_object* var_; |