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

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

Issue 278523004: Blink GC plugin: require that trace call base::trace and traceAfterDispatch call base::traceAfterDi… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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
« no previous file with comments | « no previous file | tools/clang/blink_gc_plugin/tests/finalize_after_dispatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
diff --git a/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp b/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
index e726a842e0275fc00a07ba4da571326d758c79d0..d57d7d70a2979308e10673c84af1eaa362149477 100644
--- a/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
+++ b/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
@@ -356,10 +356,13 @@ class CheckTraceVisitor : public RecursiveASTVisitor<CheckTraceVisitor> {
return true;
}
- // TODO: It is possible to have multiple bases, where one must be traced
- // using a traceAfterDispatch. In such a case we should also check that
- // the mixin does not add a vtable.
- if (Config::IsTraceMethod(fn) && member->hasQualifier()) {
+ // Currently, a manually dispatched class cannot have mixin bases (having
+ // one would add a vtable which we explicitly check against). This means
+ // that we can only make calls to a trace method of the same name. Revisit
+ // this if our mixin/vtable assumption changes.
+ if (Config::IsTraceMethod(fn) &&
+ fn->getName() == trace_->getName() &&
+ member->hasQualifier()) {
if (const Type* type = member->getQualifier()->getAsType()) {
if (CXXRecordDecl* decl = type->getAsCXXRecordDecl()) {
RecordInfo::Bases::iterator it = info_->GetBases().find(decl);
« no previous file with comments | « no previous file | tools/clang/blink_gc_plugin/tests/finalize_after_dispatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698