Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Unified Diff: runtime/vm/ast.h

Issue 10283003: - Fix another side effect issue: never add AstNode to sequence unless they are a statement. Added t… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/code_generator_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast.h
===================================================================
--- runtime/vm/ast.h (revision 7205)
+++ runtime/vm/ast.h (working copy)
@@ -1164,11 +1164,23 @@
class LoadLocalNode : public AstNode {
public:
LoadLocalNode(intptr_t token_index, const LocalVariable& local)
- : AstNode(token_index), local_(local) { }
+ : AstNode(token_index), local_(local), pseudo_(NULL) { }
+ // The pseudo node does not produce input but must be visited before
+ // completing local load.
+ LoadLocalNode(intptr_t token_index,
+ const LocalVariable& local,
+ AstNode* pseudo)
+ : AstNode(token_index), local_(local), pseudo_(pseudo) {}
const LocalVariable& local() const { return local_; }
+ AstNode* pseudo() const { return pseudo_; } // Can be NULL.
+ bool HasPseudo() const { return pseudo_ != NULL; }
- virtual void VisitChildren(AstNodeVisitor* visitor) const { }
+ virtual void VisitChildren(AstNodeVisitor* visitor) const {
+ if (HasPseudo()) {
+ pseudo()->Visit(visitor);
+ }
+ }
virtual AstNode* MakeAssignmentNode(AstNode* rhs);
@@ -1180,6 +1192,7 @@
private:
const LocalVariable& local_;
+ AstNode* pseudo_;
DISALLOW_IMPLICIT_CONSTRUCTORS(LoadLocalNode);
};
« no previous file with comments | « no previous file | runtime/vm/code_generator_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698