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

Unified Diff: src/ast/ast-literal-reindexer.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-expression-rewriter.h ('k') | src/ast/ast-literal-reindexer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast-literal-reindexer.h
diff --git a/src/ast/ast-literal-reindexer.h b/src/ast/ast-literal-reindexer.h
index e2a71d3c471837bb8c27f635eec5c94f42a8b3be..b33e0c541c9b5adc18f13e4e30260d6c19f38a83 100644
--- a/src/ast/ast-literal-reindexer.h
+++ b/src/ast/ast-literal-reindexer.h
@@ -11,20 +11,20 @@
namespace v8 {
namespace internal {
-class AstLiteralReindexer final : public AstVisitor {
+class AstLiteralReindexer final : public AstVisitor<AstLiteralReindexer> {
public:
- AstLiteralReindexer() : AstVisitor(), next_index_(0) {}
+ AstLiteralReindexer() : next_index_(0) {}
int count() const { return next_index_; }
void Reindex(Expression* pattern);
private:
-#define DEFINE_VISIT(type) void Visit##type(type* node) override;
+#define DEFINE_VISIT(type) void Visit##type(type* node);
AST_NODE_LIST(DEFINE_VISIT)
#undef DEFINE_VISIT
- void VisitStatements(ZoneList<Statement*>* statements) override;
- void VisitDeclarations(ZoneList<Declaration*>* declarations) override;
+ void VisitStatements(ZoneList<Statement*>* statements);
+ void VisitDeclarations(ZoneList<Declaration*>* declarations);
void VisitArguments(ZoneList<Expression*>* arguments);
void VisitObjectLiteralProperty(ObjectLiteralProperty* property);
@@ -32,10 +32,9 @@ class AstLiteralReindexer final : public AstVisitor {
literal->literal_index_ = next_index_++;
}
- void Visit(AstNode* node) override { node->Accept(this); }
-
int next_index_;
+ DEFINE_AST_VISITOR_MEMBERS_WITHOUT_STACKOVERFLOW()
DISALLOW_COPY_AND_ASSIGN(AstLiteralReindexer);
};
} // namespace internal
« no previous file with comments | « src/ast/ast-expression-rewriter.h ('k') | src/ast/ast-literal-reindexer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698