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

Unified Diff: test/cctest/expression-type-collector.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: back to macros 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/cctest.gyp ('k') | test/cctest/expression-type-collector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/expression-type-collector.h
diff --git a/test/cctest/expression-type-collector.h b/test/cctest/expression-type-collector.h
new file mode 100644
index 0000000000000000000000000000000000000000..4cf4e47e33676f884ef8e5de560726fc4bdd99b0
--- /dev/null
+++ b/test/cctest/expression-type-collector.h
@@ -0,0 +1,40 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_EXPRESSION_TYPE_COLLECTOR_H_
+#define V8_EXPRESSION_TYPE_COLLECTOR_H_
+
+#include "src/ast-expression-visitor.h"
+
+namespace v8 {
+namespace internal {
+
+// A Visitor over a CompilationInfo's AST that collects
+// a human readable string summarizing structure and types.
+// Used for testing of the typing information attached to the
+// expression nodes of an AST.
+
+struct ExpressionTypeEntry {
+ int depth;
+ const char* kind;
+ const AstRawString* name;
+ Bounds bounds;
+};
+
+class ExpressionTypeCollector : public AstExpressionVisitor {
+ public:
+ ExpressionTypeCollector(CompilationInfo* info,
+ ZoneVector<ExpressionTypeEntry>* dst);
+ void Run();
+
+ protected:
+ void VisitExpression(Expression* expression);
+
+ private:
+ ZoneVector<ExpressionTypeEntry>* result_;
+};
+}
+} // namespace v8::internal
+
+#endif // V8_EXPRESSION_TYPE_COLLECTOR_H_
« no previous file with comments | « test/cctest/cctest.gyp ('k') | test/cctest/expression-type-collector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698