Chromium Code Reviews| Index: runtime/vm/ast.h |
| diff --git a/runtime/vm/ast.h b/runtime/vm/ast.h |
| index 03d65a06f3561c9161e330c1ec2dadd0a08eb75a..c68460d237d3a3c601603613aad9e55e89fdb674 100644 |
| --- a/runtime/vm/ast.h |
| +++ b/runtime/vm/ast.h |
| @@ -162,7 +162,7 @@ class SequenceNode : public AstNode { |
| void VisitChildren(AstNodeVisitor* visitor) const; |
| - void Add(AstNode* node) { nodes_.Add(node); } |
| + void Add(AstNode* node); |
| intptr_t length() const { return nodes_.length(); } |
| AstNode* NodeAt(intptr_t index) const { return nodes_[index]; } |
| void ReplaceNodeAt(intptr_t index, AstNode* value) { nodes_[index] = value; } |
| @@ -522,14 +522,16 @@ class ReturnNode : public AstNode { |
| : AstNode(token_pos), |
| value_(new LiteralNode(token_pos, Instance::ZoneHandle())), |
| inlined_finally_list_(), |
| - saved_return_value_var_(NULL) { } |
| + saved_return_value_var_(NULL), |
| + is_regular_return_(true) { } |
| // Return from a non-void function. |
| ReturnNode(intptr_t token_pos, |
| AstNode* value) |
| : AstNode(token_pos), |
| value_(value), |
| inlined_finally_list_(), |
| - saved_return_value_var_(NULL) { |
| + saved_return_value_var_(NULL), |
| + is_regular_return_(true) { |
| ASSERT(value_ != NULL); |
| } |
| @@ -558,12 +560,20 @@ class ReturnNode : public AstNode { |
| } |
| } |
| + void set_scope(LocalScope* scope) { scope_ = scope; } |
| + LocalScope* scope() const { return scope_; } |
| + |
| + // Returns true if the return node is not used to return from a continuation. |
|
srdjan
2014/08/12 21:39:24
Simplify: returns false if the return node is used
Michael Lippautz (Google)
2014/08/12 21:50:51
Done.
|
| + bool is_regular_return() const { return is_regular_return_; } |
| + |
| DECLARE_COMMON_NODE_FUNCTIONS(ReturnNode); |
| private: |
| AstNode* value_; |
| GrowableArray<InlinedFinallyNode*> inlined_finally_list_; |
| LocalVariable* saved_return_value_var_; |
| + LocalScope* scope_; |
| + bool is_regular_return_; |
| DISALLOW_COPY_AND_ASSIGN(ReturnNode); |
| }; |