Chromium Code Reviews| 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; |
| } |