OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/ast.h" | 5 #include "vm/ast.h" |
6 #include "vm/compiler.h" | 6 #include "vm/compiler.h" |
7 #include "vm/dart_entry.h" | 7 #include "vm/dart_entry.h" |
8 #include "vm/isolate.h" | 8 #include "vm/isolate.h" |
9 #include "vm/log.h" | 9 #include "vm/log.h" |
10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
11 #include "vm/resolver.h" | 11 #include "vm/resolver.h" |
12 | 12 |
13 | 13 |
14 namespace dart { | 14 namespace dart { |
15 | 15 |
16 DEFINE_FLAG(bool, trace_ast_visitor, false, | |
17 "Trace AstVisitor."); | |
18 | |
19 #define DEFINE_VISIT_FUNCTION(BaseName) \ | 16 #define DEFINE_VISIT_FUNCTION(BaseName) \ |
20 void BaseName##Node::Visit(AstNodeVisitor* visitor) { \ | 17 void BaseName##Node::Visit(AstNodeVisitor* visitor) { \ |
21 if (FLAG_trace_ast_visitor) { \ | |
22 THR_Print("Visiting %s\n", Name()); \ | |
23 } \ | |
24 visitor->Visit##BaseName##Node(this); \ | 18 visitor->Visit##BaseName##Node(this); \ |
25 } | 19 } |
26 | 20 |
27 FOR_EACH_NODE(DEFINE_VISIT_FUNCTION) | 21 FOR_EACH_NODE(DEFINE_VISIT_FUNCTION) |
28 #undef DEFINE_VISIT_FUNCTION | 22 #undef DEFINE_VISIT_FUNCTION |
29 | 23 |
30 | 24 |
31 #define DEFINE_NAME_FUNCTION(BaseName) \ | 25 #define DEFINE_NAME_FUNCTION(BaseName) \ |
32 const char* BaseName##Node::Name() const { \ | 26 const char* BaseName##Node::Name() const { \ |
33 return #BaseName; \ | 27 return #BaseName; \ |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 if (result.IsError() || result.IsNull()) { | 823 if (result.IsError() || result.IsNull()) { |
830 // TODO(turnidge): We could get better error messages by returning | 824 // TODO(turnidge): We could get better error messages by returning |
831 // the Error object directly to the parser. This will involve | 825 // the Error object directly to the parser. This will involve |
832 // replumbing all of the EvalConstExpr methods. | 826 // replumbing all of the EvalConstExpr methods. |
833 return NULL; | 827 return NULL; |
834 } | 828 } |
835 return &Instance::ZoneHandle(Instance::Cast(result).raw()); | 829 return &Instance::ZoneHandle(Instance::Cast(result).raw()); |
836 } | 830 } |
837 | 831 |
838 } // namespace dart | 832 } // namespace dart |
OLD | NEW |