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

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

Issue 2060553002: GC plugin: improve error reporting when tracing illegal fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: robustify namespace equality checking instead Created 4 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/CheckFieldsVisitor.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/CheckFieldsVisitor.cpp
diff --git a/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp b/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp
index e5d69f0b897c0a13e8b0b0cbdc2b544632b38272..396ed95bf1cfea3de07cc57799a899c8e2678101 100644
--- a/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp
+++ b/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp
@@ -86,6 +86,7 @@ void CheckFieldsVisitor::AtValue(Value* edge) {
// Disallow OwnPtr<T>, RefPtr<T> and T* to stack-allocated types.
if (Parent()->IsOwnPtr() ||
+ Parent()->IsUniquePtr() ||
Parent()->IsRefPtr() ||
(stack_allocated_host_ && Parent()->IsRawPtr())) {
invalid_fields_.push_back(std::make_pair(
@@ -103,6 +104,8 @@ void CheckFieldsVisitor::AtValue(Value* edge) {
void CheckFieldsVisitor::AtCollection(Collection* edge) {
if (edge->on_heap() && Parent() && Parent()->IsOwnPtr())
invalid_fields_.push_back(std::make_pair(current_, kOwnPtrToGCManaged));
+ if (edge->on_heap() && Parent() && Parent()->IsUniquePtr())
+ invalid_fields_.push_back(std::make_pair(current_, kUniquePtrToGCManaged));
}
CheckFieldsVisitor::Error CheckFieldsVisitor::InvalidSmartPtr(Edge* ptr) {
@@ -116,5 +119,7 @@ CheckFieldsVisitor::Error CheckFieldsVisitor::InvalidSmartPtr(Edge* ptr) {
return kRefPtrToGCManaged;
if (ptr->IsOwnPtr())
return kOwnPtrToGCManaged;
+ if (ptr->IsUniquePtr())
+ return kUniquePtrToGCManaged;
assert(false && "Unknown smart pointer kind");
}
« no previous file with comments | « tools/clang/blink_gc_plugin/CheckFieldsVisitor.h ('k') | tools/clang/blink_gc_plugin/Config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698