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

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

Issue 2655933002: blink_gc_plugin: retire overloaded traceImpl detection and handling. (Closed)
Patch Set: Created 3 years, 11 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 | « tools/clang/blink_gc_plugin/CheckTraceVisitor.h ('k') | tools/clang/blink_gc_plugin/Config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/blink_gc_plugin/CheckTraceVisitor.cpp
diff --git a/tools/clang/blink_gc_plugin/CheckTraceVisitor.cpp b/tools/clang/blink_gc_plugin/CheckTraceVisitor.cpp
index c996ca7dd1480a76c65ddf12f3fd8d2215aa7009..8f6639eae4160b40853654fbbe883a77198b18ed 100644
--- a/tools/clang/blink_gc_plugin/CheckTraceVisitor.cpp
+++ b/tools/clang/blink_gc_plugin/CheckTraceVisitor.cpp
@@ -13,15 +13,7 @@ using namespace clang;
CheckTraceVisitor::CheckTraceVisitor(CXXMethodDecl* trace,
RecordInfo* info,
RecordCache* cache)
- : trace_(trace),
- info_(info),
- cache_(cache),
- delegates_to_traceimpl_(false) {
-}
-
-bool CheckTraceVisitor::delegates_to_traceimpl() const {
- return delegates_to_traceimpl_;
-}
+ : trace_(trace), info_(info), cache_(cache) {}
bool CheckTraceVisitor::VisitMemberExpr(MemberExpr* member) {
// In weak callbacks, consider any occurrence as a correct usage.
@@ -72,8 +64,6 @@ bool CheckTraceVisitor::VisitCallExpr(CallExpr* call) {
CXXRecordDecl* decl = base->getPointeeType()->getAsCXXRecordDecl();
if (decl)
CheckTraceFieldCall(expr->getMemberName().getAsString(), decl, arg);
- if (Config::IsTraceImplName(expr->getMemberName().getAsString()))
- delegates_to_traceimpl_ = true;
return true;
}
@@ -81,10 +71,6 @@ bool CheckTraceVisitor::VisitCallExpr(CallExpr* call) {
if (CheckTraceFieldMemberCall(expr) || CheckRegisterWeakMembers(expr))
return true;
- if (Config::IsTraceImplName(expr->getMethodDecl()->getNameAsString())) {
- delegates_to_traceimpl_ = true;
- return true;
- }
}
CheckTraceBaseCall(call);
@@ -92,10 +78,6 @@ bool CheckTraceVisitor::VisitCallExpr(CallExpr* call) {
}
bool CheckTraceVisitor::IsTraceCallName(const std::string& name) {
- if (trace_->getName() == kTraceImplName)
- return name == kTraceName;
- if (trace_->getName() == kTraceAfterDispatchImplName)
- return name == kTraceAfterDispatchName;
// 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
@@ -232,8 +214,7 @@ bool CheckTraceVisitor::CheckTraceBaseCall(CallExpr* call) {
dyn_cast<UnresolvedMemberExpr>(call->getCallee())) {
// Callee part may become unresolved if the type of the argument
// ("visitor") is a template parameter and the called function is
- // overloaded (i.e. trace(Visitor*) and
- // trace(InlinedGlobalMarkingVisitor)).
+ // overloaded.
//
// Here, we try to find a function that looks like trace() from the
// candidate overloaded functions, and if we find one, we assume it is
@@ -351,6 +332,8 @@ bool CheckTraceVisitor::CheckRegisterWeakMembers(CXXMemberCallExpr* call) {
nested_visitor.TraverseStmt(callback->getBody());
}
}
+ // TODO: mark all WeakMember<>s as traced even if
+ // the body isn't available?
}
}
return true;
« no previous file with comments | « tools/clang/blink_gc_plugin/CheckTraceVisitor.h ('k') | tools/clang/blink_gc_plugin/Config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698