CheckDispatchVisitor.h 978 B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2015 The Chromium 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. #ifndef TOOLS_BLINK_GC_PLUGIN_CHECK_DISPATCH_VISITOR_H_
  5. #define TOOLS_BLINK_GC_PLUGIN_CHECK_DISPATCH_VISITOR_H_
  6. #include "clang/AST/RecursiveASTVisitor.h"
  7. class RecordInfo;
  8. // This visitor checks that a method contains within its body, a call to a
  9. // method on the provided receiver class. This is used to check manual
  10. // dispatching for trace and finalize methods.
  11. class CheckDispatchVisitor
  12. : public clang::RecursiveASTVisitor<CheckDispatchVisitor> {
  13. public:
  14. explicit CheckDispatchVisitor(RecordInfo* receiver);
  15. bool dispatched_to_receiver();
  16. bool VisitMemberExpr(clang::MemberExpr* member);
  17. bool VisitUnresolvedMemberExpr(clang::UnresolvedMemberExpr* member);
  18. private:
  19. RecordInfo* receiver_;
  20. bool dispatched_to_receiver_;
  21. };
  22. #endif // TOOLS_BLINK_GC_PLUGIN_CHECK_DISPATCH_VISITOR_H_