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

Side by Side Diff: tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp

Issue 1932713002: Remove RefCountedGarbageCollected<> GC plugin handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/clang/blink_gc_plugin/Config.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "CheckFieldsVisitor.h" 5 #include "CheckFieldsVisitor.h"
6 6
7 #include <cassert> 7 #include <cassert>
8 8
9 #include "BlinkGCPluginOptions.h" 9 #include "BlinkGCPluginOptions.h"
10 #include "RecordInfo.h" 10 #include "RecordInfo.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 invalid_fields_.push_back(std::make_pair(current_, 79 invalid_fields_.push_back(std::make_pair(current_,
80 kMemberToGCUnmanaged)); 80 kMemberToGCUnmanaged));
81 return; 81 return;
82 } 82 }
83 83
84 if (!Parent() || !edge->value()->IsGCAllocated()) 84 if (!Parent() || !edge->value()->IsGCAllocated())
85 return; 85 return;
86 86
87 // Disallow OwnPtr<T>, RefPtr<T> and T* to stack-allocated types. 87 // Disallow OwnPtr<T>, RefPtr<T> and T* to stack-allocated types.
88 if (Parent()->IsOwnPtr() || 88 if (Parent()->IsOwnPtr() ||
89 (Parent()->IsRefPtr() && !edge->value()->IsGCRefCounted()) || 89 Parent()->IsRefPtr() ||
90 (stack_allocated_host_ && Parent()->IsRawPtr())) { 90 (stack_allocated_host_ && Parent()->IsRawPtr())) {
91 invalid_fields_.push_back(std::make_pair( 91 invalid_fields_.push_back(std::make_pair(
92 current_, InvalidSmartPtr(Parent()))); 92 current_, InvalidSmartPtr(Parent())));
93 return; 93 return;
94 } 94 }
95 if (Parent()->IsRawPtr()) { 95 if (Parent()->IsRawPtr()) {
96 RawPtr* rawPtr = static_cast<RawPtr*>(Parent()); 96 RawPtr* rawPtr = static_cast<RawPtr*>(Parent());
97 Error error = rawPtr->HasReferenceType() ? 97 Error error = rawPtr->HasReferenceType() ?
98 kReferencePtrToGCManaged : kRawPtrToGCManaged; 98 kReferencePtrToGCManaged : kRawPtrToGCManaged;
99 invalid_fields_.push_back(std::make_pair(current_, error)); 99 invalid_fields_.push_back(std::make_pair(current_, error));
(...skipping 11 matching lines...) Expand all
111 return kReferencePtrToGCManaged; 111 return kReferencePtrToGCManaged;
112 else 112 else
113 return kRawPtrToGCManaged; 113 return kRawPtrToGCManaged;
114 } 114 }
115 if (ptr->IsRefPtr()) 115 if (ptr->IsRefPtr())
116 return kRefPtrToGCManaged; 116 return kRefPtrToGCManaged;
117 if (ptr->IsOwnPtr()) 117 if (ptr->IsOwnPtr())
118 return kOwnPtrToGCManaged; 118 return kOwnPtrToGCManaged;
119 assert(false && "Unknown smart pointer kind"); 119 assert(false && "Unknown smart pointer kind");
120 } 120 }
OLDNEW
« no previous file with comments | « no previous file | tools/clang/blink_gc_plugin/Config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698