blob: 60309815ed603041ac6e778f1e650a32383dbfc9 [file] [log] [blame]
Emily Bernierd0a1eb72015-03-24 16:35:39 -04001// Copyright 2014 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_AST_THIS_ACCESS_VISITOR_H_
6#define V8_AST_THIS_ACCESS_VISITOR_H_
7#include "src/ast.h"
8
9namespace v8 {
10namespace internal {
11
12class AstThisAccessVisitor : public AstVisitor {
13 public:
14 explicit AstThisAccessVisitor(Zone* zone);
15
16 bool UsesThis() { return uses_this_; }
17
18#define DECLARE_VISIT(type) void Visit##type(type* node) OVERRIDE;
19 AST_NODE_LIST(DECLARE_VISIT)
20#undef DECLARE_VISIT
21
22 private:
23 bool uses_this_;
24
25 void VisitIfNotNull(AstNode* node) {
26 if (node != NULL) Visit(node);
27 }
28
29 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
30 DISALLOW_COPY_AND_ASSIGN(AstThisAccessVisitor);
31};
32}
33} // namespace v8::internal
34#endif // V8_AST_THIS_ACCESS_VISITOR_H_