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

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

Issue 960873002: Update from https://crrev.com/318214 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 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/Config.h ('k') | tools/clang/blink_gc_plugin/tests/heap/stubs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/blink_gc_plugin/RecordInfo.cpp
diff --git a/tools/clang/blink_gc_plugin/RecordInfo.cpp b/tools/clang/blink_gc_plugin/RecordInfo.cpp
index 1bf954e5c5f7bcd37fe110de69c6a23b1d531c99..025741519cb8e1946c3379dcaa378efb30d450aa 100644
--- a/tools/clang/blink_gc_plugin/RecordInfo.cpp
+++ b/tools/clang/blink_gc_plugin/RecordInfo.cpp
@@ -426,39 +426,45 @@ void RecordInfo::DetermineTracingMethods() {
determined_trace_methods_ = true;
if (Config::IsGCBase(name_))
return;
- CXXMethodDecl* trace = 0;
- CXXMethodDecl* traceAfterDispatch = 0;
- bool isTraceAfterDispatch;
- bool hasAdjustAndMark = false;
- bool hasIsHeapObjectAlive = false;
+ CXXMethodDecl* trace = nullptr;
+ CXXMethodDecl* trace_after_dispatch = nullptr;
+ bool has_adjust_and_mark = false;
+ bool has_is_heap_object_alive = false;
for (CXXRecordDecl::method_iterator it = record_->method_begin();
it != record_->method_end();
++it) {
- if (Config::IsTraceMethod(*it, &isTraceAfterDispatch)) {
- if (isTraceAfterDispatch) {
- traceAfterDispatch = *it;
- } else {
+ switch (Config::GetTraceMethodType(*it)) {
+ case Config::TRACE_METHOD:
trace = *it;
- }
- } else if (it->getNameAsString() == kFinalizeName) {
- finalize_dispatch_method_ = *it;
- } else if (it->getNameAsString() == kAdjustAndMarkName) {
- hasAdjustAndMark = true;
- } else if (it->getNameAsString() == kIsHeapObjectAliveName) {
- hasIsHeapObjectAlive = true;
+ break;
+ case Config::TRACE_AFTER_DISPATCH_METHOD:
+ trace_after_dispatch = *it;
+ break;
+ case Config::TRACE_IMPL_METHOD:
+ case Config::TRACE_AFTER_DISPATCH_IMPL_METHOD:
+ break;
+ case Config::NOT_TRACE_METHOD:
+ if (it->getNameAsString() == kFinalizeName) {
+ finalize_dispatch_method_ = *it;
+ } else if (it->getNameAsString() == kAdjustAndMarkName) {
+ has_adjust_and_mark = true;
+ } else if (it->getNameAsString() == kIsHeapObjectAliveName) {
+ has_is_heap_object_alive = true;
+ }
+ break;
}
}
// Record if class defines the two GCMixin methods.
has_gc_mixin_methods_ =
- hasAdjustAndMark && hasIsHeapObjectAlive ? kTrue : kFalse;
- if (traceAfterDispatch) {
- trace_method_ = traceAfterDispatch;
+ has_adjust_and_mark && has_is_heap_object_alive ? kTrue : kFalse;
+ if (trace_after_dispatch) {
+ trace_method_ = trace_after_dispatch;
trace_dispatch_method_ = trace;
} else {
// TODO: Can we never have a dispatch method called trace without the same
// class defining a traceAfterDispatch method?
trace_method_ = trace;
- trace_dispatch_method_ = 0;
+ trace_dispatch_method_ = nullptr;
}
if (trace_dispatch_method_ && finalize_dispatch_method_)
return;
« no previous file with comments | « tools/clang/blink_gc_plugin/Config.h ('k') | tools/clang/blink_gc_plugin/tests/heap/stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698