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..59ff5214688397c225b0f16070dde68cd34c200d |
--- /dev/null |
+++ b/test/cctest/expression-type-collector.h |
@@ -0,0 +1,33 @@ |
+// 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. |
+ |
+class ExpressionTypeCollector : public AstExpressionVisitor { |
+ public: |
+ static std::string Run(CompilationInfo* info); |
+ |
+ protected: |
+ void VisitExpression(Expression* expression); |
+ |
+ private: |
+ explicit ExpressionTypeCollector(CompilationInfo* info); |
+ |
+ std::string types_; |
+}; |
+} |
+} // namespace v8::internal |
+ |
+#endif // V8_EXPRESSION_TYPE_COLLECTOR_H_ |