diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-13 17:21:40 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-13 17:21:40 +0000 |
commit | a4f79468069de699d23db15e27100d2d00bb7fee (patch) | |
tree | d0f34b93af34f4568ebd1cc7e696bdb5d380cb07 /gcc/go/gofrontend/statements.h | |
parent | 99c1d5bcdb5832b179cf456e4d2e601a59f7c7f1 (diff) | |
download | gcc-a4f79468069de699d23db15e27100d2d00bb7fee.tar.gz |
Fix inherited hidden methods that return hidden types.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178818 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/go/gofrontend/statements.h')
-rw-r--r-- | gcc/go/gofrontend/statements.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/gcc/go/gofrontend/statements.h b/gcc/go/gofrontend/statements.h index 0a87a8b733c..8206a08c361 100644 --- a/gcc/go/gofrontend/statements.h +++ b/gcc/go/gofrontend/statements.h @@ -204,7 +204,7 @@ class Statement make_defer_statement(Call_expression* call, source_location); // Make a return statement. - static Statement* + static Return_statement* make_return_statement(Expression_list*, source_location); // Make a break statement. @@ -482,13 +482,20 @@ class Temporary_statement : public Statement public: Temporary_statement(Type* type, Expression* init, source_location location) : Statement(STATEMENT_TEMPORARY, location), - type_(type), init_(init), bvariable_(NULL), is_address_taken_(false) + type_(type), init_(init), bvariable_(NULL), are_hidden_fields_ok_(false), + is_address_taken_(false) { } // Return the type of the temporary variable. Type* type() const; + // Note that it is OK for this return statement to set hidden + // fields. + void + set_hidden_fields_are_ok() + { this->are_hidden_fields_ok_ = true; } + // Record that something takes the address of this temporary // variable. void @@ -526,6 +533,9 @@ class Temporary_statement : public Statement Expression* init_; // The backend representation of the temporary variable. Bvariable* bvariable_; + // True if this statement may pass hidden fields in the return + // value. This is used for generated method stubs. + bool are_hidden_fields_ok_; // True if something takes the address of this temporary variable. bool is_address_taken_; }; @@ -570,7 +580,7 @@ class Return_statement : public Statement public: Return_statement(Expression_list* vals, source_location location) : Statement(STATEMENT_RETURN, location), - vals_(vals), is_lowered_(false) + vals_(vals), are_hidden_fields_ok_(false), is_lowered_(false) { } // The list of values being returned. This may be NULL. @@ -578,6 +588,12 @@ class Return_statement : public Statement vals() const { return this->vals_; } + // Note that it is OK for this return statement to set hidden + // fields. + void + set_hidden_fields_are_ok() + { this->are_hidden_fields_ok_ = true; } + protected: int do_traverse(Traverse* traverse) @@ -602,6 +618,9 @@ class Return_statement : public Statement private: // Return values. This may be NULL. Expression_list* vals_; + // True if this statement may pass hidden fields in the return + // value. This is used for generated method stubs. + bool are_hidden_fields_ok_; // True if this statement has been lowered. bool is_lowered_; }; |