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

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

Issue 1180693002: Update from https://crrev.com/333737 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 6 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/RecordInfo.h ('k') | tools/clang/blink_gc_plugin/tests/cycle_super_neg.txt » ('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 bda33fa992fb5cd92a907fcbb8d9b1c18c94a61b..3749594333c114bfa4a1895840a0712b10a9d813 100644
--- a/tools/clang/blink_gc_plugin/RecordInfo.cpp
+++ b/tools/clang/blink_gc_plugin/RecordInfo.cpp
@@ -21,6 +21,7 @@ RecordInfo::RecordInfo(CXXRecordDecl* record, RecordCache* cache)
does_need_finalization_(kNotComputed),
has_gc_mixin_methods_(kNotComputed),
is_declaring_local_trace_(kNotComputed),
+ is_eagerly_finalized_(kNotComputed),
determined_trace_methods_(false),
trace_method_(0),
trace_dispatch_method_(0),
@@ -168,6 +169,27 @@ bool RecordInfo::IsGCAllocated() {
return IsGCDerived() || IsHeapAllocatedCollection();
}
+bool RecordInfo::IsEagerlyFinalized() {
+ if (is_eagerly_finalized_ == kNotComputed) {
+ is_eagerly_finalized_ = kFalse;
+ if (IsGCFinalized()) {
+ for (Decl* decl : record_->decls()) {
+ if (TypedefDecl* typedef_decl = dyn_cast<TypedefDecl>(decl)) {
+ if (typedef_decl->getNameAsString() == kIsEagerlyFinalizedName) {
+ is_eagerly_finalized_ = kTrue;
+ break;
+ }
+ }
+ }
+ }
+ }
+ return is_eagerly_finalized_;
+}
+
+bool RecordInfo::HasDefinition() {
+ return record_->hasDefinition();
+}
+
RecordInfo* RecordCache::Lookup(CXXRecordDecl* record) {
// Ignore classes annotated with the GC_PLUGIN_IGNORE macro.
if (!record || Config::IsIgnoreAnnotated(record))
« no previous file with comments | « tools/clang/blink_gc_plugin/RecordInfo.h ('k') | tools/clang/blink_gc_plugin/tests/cycle_super_neg.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698