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

Unified Diff: tools/clang/blink_gc_plugin/RecordInfo.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: 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/RecordInfo.h ('k') | tools/clang/blink_gc_plugin/TracingStatus.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 f0e2ade715bb63255b5d0e34eaf54097de1c28b7..0b37e35393b037efbacfb8ba97694ab5a4d3497f 100644
--- a/tools/clang/blink_gc_plugin/RecordInfo.cpp
+++ b/tools/clang/blink_gc_plugin/RecordInfo.cpp
@@ -599,6 +599,19 @@ Edge* RecordInfo::CreateEdge(const Type* type) {
return 0;
}
+ if (Config::IsUniquePtr(info->name()) && info->GetTemplateArgs(1, &args)) {
+ // Check that this is std::unique_ptr
+ NamespaceDecl* ns =
+ dyn_cast<NamespaceDecl>(info->record()->getDeclContext());
+ if (!ns || ns->getName() != "std")
Nico 2016/06/14 11:35:15 (this isn't new in this patch, but in general i th
sof 2016/06/14 21:01:22 Thanks for the Sema tip, adjusted to use instead.
+ return 0;
+ if (!info->GetTemplateArgs(1, &args))
+ return 0;
+ if (Edge* ptr = CreateEdge(args[0]))
+ return new UniquePtr(ptr);
+ return 0;
+ }
+
if (Config::IsMember(info->name()) && info->GetTemplateArgs(1, &args)) {
if (Edge* ptr = CreateEdge(args[0]))
return new Member(ptr);
@@ -611,7 +624,8 @@ Edge* RecordInfo::CreateEdge(const Type* type) {
return 0;
}
- if (Config::IsPersistent(info->name())) {
+ bool is_persistent = Config::IsPersistent(info->name());
+ if (is_persistent || Config::IsCrossThreadPersistent(info->name())) {
// Persistent might refer to v8::Persistent, so check the name space.
// TODO: Consider using a more canonical identification than names.
NamespaceDecl* ns =
@@ -620,8 +634,12 @@ Edge* RecordInfo::CreateEdge(const Type* type) {
return 0;
if (!info->GetTemplateArgs(1, &args))
return 0;
- if (Edge* ptr = CreateEdge(args[0]))
- return new Persistent(ptr);
+ if (Edge* ptr = CreateEdge(args[0])) {
+ if (is_persistent)
+ return new Persistent(ptr);
+ else
+ return new CrossThreadPersistent(ptr);
+ }
return 0;
}
« no previous file with comments | « tools/clang/blink_gc_plugin/RecordInfo.h ('k') | tools/clang/blink_gc_plugin/TracingStatus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698