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

Unified Diff: tools/clang/blink_gc_plugin/CheckDispatchVisitor.cpp

Issue 1385193002: Bisect clang Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 246985 Created 5 years, 2 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
Index: tools/clang/blink_gc_plugin/CheckDispatchVisitor.cpp
diff --git a/tools/clang/blink_gc_plugin/CheckDispatchVisitor.cpp b/tools/clang/blink_gc_plugin/CheckDispatchVisitor.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9c3de6d86c30bc7212bb5b74d6f7dfb422c18344
--- /dev/null
+++ b/tools/clang/blink_gc_plugin/CheckDispatchVisitor.cpp
@@ -0,0 +1,42 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "CheckDispatchVisitor.h"
+
+#include "Config.h"
+#include "RecordInfo.h"
+
+using namespace clang;
+
+CheckDispatchVisitor::CheckDispatchVisitor(RecordInfo* receiver)
+ : receiver_(receiver),
+ dispatched_to_receiver_(false) {
+}
+
+bool CheckDispatchVisitor::dispatched_to_receiver() {
+ return dispatched_to_receiver_;
+}
+
+bool CheckDispatchVisitor::VisitMemberExpr(MemberExpr* member) {
+ if (CXXMethodDecl* fn = dyn_cast<CXXMethodDecl>(member->getMemberDecl())) {
+ if (fn->getParent() == receiver_->record())
+ dispatched_to_receiver_ = true;
+ }
+ return true;
+}
+
+bool CheckDispatchVisitor::VisitUnresolvedMemberExpr(
+ UnresolvedMemberExpr* member) {
+ for (Decl* decl : member->decls()) {
+ if (CXXMethodDecl* method = dyn_cast<CXXMethodDecl>(decl)) {
+ if (method->getParent() == receiver_->record() &&
+ Config::GetTraceMethodType(method) ==
+ Config::TRACE_AFTER_DISPATCH_METHOD) {
+ dispatched_to_receiver_ = true;
+ return true;
+ }
+ }
+ }
+ return true;
+}
« no previous file with comments | « tools/clang/blink_gc_plugin/CheckDispatchVisitor.h ('k') | tools/clang/blink_gc_plugin/CheckFieldsVisitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698