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

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

Issue 1895943002: Update Blink GC plugin to reflect that Oilpan is now always enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/CheckFieldsVisitor.h ('k') | tools/clang/blink_gc_plugin/Edge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp
diff --git a/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp b/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp
index 558637c9c190b5489e0ddccf37b0c62f921568af..b4eb04b5d0d88aecd8d7ed8bdb8ac233b30d0108 100644
--- a/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp
+++ b/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp
@@ -85,38 +85,22 @@ void CheckFieldsVisitor::AtValue(Value* edge) {
if (!Parent() || !edge->value()->IsGCAllocated())
return;
- // In transition mode, disallow OwnPtr<T>, RawPtr<T> to GC allocated T's,
- // also disallow T* in stack-allocated types.
- if (options_.enable_oilpan) {
- if (Parent()->IsOwnPtr() ||
- Parent()->IsRawPtrClass() ||
- (stack_allocated_host_ && Parent()->IsRawPtr())) {
- invalid_fields_.push_back(std::make_pair(
- current_, InvalidSmartPtr(Parent())));
- return;
- }
- if (options_.warn_raw_ptr && Parent()->IsRawPtr()) {
- if (static_cast<RawPtr*>(Parent())->HasReferenceType()) {
- invalid_fields_.push_back(std::make_pair(
- current_, kReferencePtrToGCManagedWarning));
- } else {
- invalid_fields_.push_back(std::make_pair(
- current_, kRawPtrToGCManagedWarning));
- }
- }
- return;
- }
-
- if (Parent()->IsRawPtr() || Parent()->IsOwnPtr()) {
+ // Disallow OwnPtr<T>, RefPtr<T> and T* to stack-allocated types.
+ if (Parent()->IsOwnPtr() ||
+ (Parent()->IsRefPtr() && !edge->value()->IsGCRefCounted()) ||
sof 2016/04/18 21:23:15 Note: this RefPtr<T> check wasn't previously done
+ (stack_allocated_host_ && Parent()->IsRawPtr())) {
invalid_fields_.push_back(std::make_pair(
current_, InvalidSmartPtr(Parent())));
return;
}
-
- if (Parent()->IsRefPtr() && !edge->value()->IsGCRefCounted()) {
- invalid_fields_.push_back(std::make_pair(
- current_, InvalidSmartPtr(Parent())));
- return;
+ if (options_.warn_raw_ptr && Parent()->IsRawPtr()) {
+ if (static_cast<RawPtr*>(Parent())->HasReferenceType()) {
+ invalid_fields_.push_back(std::make_pair(
+ current_, kReferencePtrToGCManagedWarning));
+ } else {
+ invalid_fields_.push_back(std::make_pair(
+ current_, kRawPtrToGCManagedWarning));
+ }
}
}
« no previous file with comments | « tools/clang/blink_gc_plugin/CheckFieldsVisitor.h ('k') | tools/clang/blink_gc_plugin/Edge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698