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

Unified Diff: src/ast/ast-expression-rewriter.h

Issue 2142233003: Templatize AstVisitor with its subclass (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 4 years, 5 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 | « src/ast/ast.cc ('k') | src/ast/ast-literal-reindexer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast-expression-rewriter.h
diff --git a/src/ast/ast-expression-rewriter.h b/src/ast/ast-expression-rewriter.h
index 1da3fa82474646725f9713a40415eb9b9a38480a..ac45d76b30688a1e27e5c5d51ac983174770d372 100644
--- a/src/ast/ast-expression-rewriter.h
+++ b/src/ast/ast-expression-rewriter.h
@@ -17,19 +17,21 @@ namespace internal {
// A rewriting Visitor over a CompilationInfo's AST that invokes
// VisitExpression on each expression node.
-class AstExpressionRewriter : public AstVisitor {
+// This AstVistor is not final, and provides the AstVisitor methods as virtual
+// methods so they can be specialized by subclasses.
+class AstExpressionRewriter : public AstVisitor<AstExpressionRewriter> {
public:
- explicit AstExpressionRewriter(Isolate* isolate) : AstVisitor() {
+ explicit AstExpressionRewriter(Isolate* isolate) {
InitializeAstRewriter(isolate);
}
- explicit AstExpressionRewriter(uintptr_t stack_limit) : AstVisitor() {
+ explicit AstExpressionRewriter(uintptr_t stack_limit) {
InitializeAstRewriter(stack_limit);
}
- ~AstExpressionRewriter() override {}
+ virtual ~AstExpressionRewriter() {}
- void VisitDeclarations(ZoneList<Declaration*>* declarations) override;
- void VisitStatements(ZoneList<Statement*>* statements) override;
- void VisitExpressions(ZoneList<Expression*>* expressions) override;
+ virtual void VisitDeclarations(ZoneList<Declaration*>* declarations);
+ virtual void VisitStatements(ZoneList<Statement*>* statements);
+ virtual void VisitExpressions(ZoneList<Expression*>* expressions);
virtual void VisitObjectLiteralProperty(ObjectLiteralProperty* property);
@@ -39,7 +41,7 @@ class AstExpressionRewriter : public AstVisitor {
private:
DEFINE_AST_REWRITER_SUBCLASS_MEMBERS();
-#define DECLARE_VISIT(type) void Visit##type(type* node) override;
+#define DECLARE_VISIT(type) virtual void Visit##type(type* node);
AST_NODE_LIST(DECLARE_VISIT)
#undef DECLARE_VISIT
« no previous file with comments | « src/ast/ast.cc ('k') | src/ast/ast-literal-reindexer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698