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

Side by Side Diff: src/ast-expression-visitor.h

Issue 1288773007: Adding visitors to regurgitate expression types or reset them. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 years, 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef V8_AST_EXPRESSION_VISITOR_H_
6 #define V8_AST_EXPRESSION_VISITOR_H_
7
8 #include "src/allocation.h"
9 #include "src/ast.h"
10 #include "src/effects.h"
11 #include "src/scopes.h"
12 #include "src/type-info.h"
13 #include "src/types.h"
14 #include "src/zone.h"
15
16 namespace v8 {
17 namespace internal {
18
19 // A Visitor over a CompilationInfo's AST that invokes
20 // VisitExpression on each expression node.
21
22 class AstExpressionVisitor : public AstVisitor {
23 public:
24 explicit AstExpressionVisitor(CompilationInfo* info);
25 void Run();
26
27 protected:
28 virtual void VisitExpression(Expression* expression) = 0;
29 int depth() { return depth_; }
30
31 private:
32 bool VisitDeeperExpression(Expression* expression);
33 void VisitDeclarations(ZoneList<Declaration*>* d) override;
34 void VisitStatements(ZoneList<Statement*>* s) override;
35
36 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
37
38 #define DECLARE_VISIT(type) virtual void Visit##type(type* node) override;
39 AST_NODE_LIST(DECLARE_VISIT)
40 #undef DECLARE_VISIT
41
42 CompilationInfo* compilation_info_;
43 int depth_;
44
45 DISALLOW_COPY_AND_ASSIGN(AstExpressionVisitor);
46 };
47 }
48 } // namespace v8::internal
49
50 #endif // V8_AST_EXPRESSION_VISITOR_H_
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/ast-expression-visitor.cc » ('j') | src/ast-expression-visitor.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698