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

Unified Diff: src/ast/prettyprinter.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-numbering.cc ('k') | src/compiler/ast-graph-builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/prettyprinter.h
diff --git a/src/ast/prettyprinter.h b/src/ast/prettyprinter.h
index 95af95b2aa83de56a494ed45df317f8ae881004a..d7d23c553d2b1046e76a07748456592664232f61 100644
--- a/src/ast/prettyprinter.h
+++ b/src/ast/prettyprinter.h
@@ -12,10 +12,10 @@
namespace v8 {
namespace internal {
-class CallPrinter : public AstVisitor {
+class CallPrinter final : public AstVisitor<CallPrinter> {
public:
explicit CallPrinter(Isolate* isolate, bool is_builtin);
- virtual ~CallPrinter();
+ ~CallPrinter();
// The following routine prints the node with position |position| into a
// string. The result string is alive as long as the CallPrinter is alive.
@@ -26,7 +26,7 @@ class CallPrinter : public AstVisitor {
void Find(AstNode* node, bool print = false);
// Individual nodes
-#define DECLARE_VISIT(type) void Visit##type(type* node) override;
+#define DECLARE_VISIT(type) void Visit##type(type* node);
AST_NODE_LIST(DECLARE_VISIT)
#undef DECLARE_VISIT
@@ -53,14 +53,13 @@ class CallPrinter : public AstVisitor {
#ifdef DEBUG
-// Prints the AST structure
-class AstPrinter : public AstVisitor {
+class AstPrinter final : public AstVisitor<AstPrinter> {
public:
explicit AstPrinter(Isolate* isolate);
- virtual ~AstPrinter();
+ ~AstPrinter();
// The following routines print a node into a string.
- // The result string is alive as long as the PrettyPrinter is alive.
+ // The result string is alive as long as the AstPrinter is alive.
const char* Print(AstNode* node);
const char* PrintProgram(FunctionLiteral* program);
@@ -70,7 +69,7 @@ class AstPrinter : public AstVisitor {
static void PrintOut(Isolate* isolate, AstNode* node);
// Individual nodes
-#define DECLARE_VISIT(type) void Visit##type(type* node) override;
+#define DECLARE_VISIT(type) void Visit##type(type* node);
AST_NODE_LIST(DECLARE_VISIT)
#undef DECLARE_VISIT
« no previous file with comments | « src/ast/ast-numbering.cc ('k') | src/compiler/ast-graph-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698