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

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

Issue 306473005: Blink GC plugin: support checking structures in anonymous namespaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
diff --git a/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp b/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
index bdc5ca64c2913a2d3d9e4e297912e26527060535..0ea8f4cac36330f042492810e86e52989a56a7ab 100644
--- a/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
+++ b/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
@@ -1093,17 +1093,15 @@ class BlinkGCPluginConsumer : public ASTConsumer {
bool InCheckedNamespace(RecordInfo* info) {
if (!info)
return false;
- DeclContext* context = info->record()->getDeclContext();
- if (context->isRecord())
- return InCheckedNamespace(cache_.Lookup(context));
- while (context->isNamespace()) {
- NamespaceDecl* decl = dyn_cast<NamespaceDecl>(context);
- if (decl->isAnonymousNamespace())
- return false;
- if (options_.checked_namespaces.find(decl->getNameAsString()) !=
- options_.checked_namespaces.end())
- return true;
- context = decl->getDeclContext();
+ for (DeclContext* context = info->record()->getDeclContext();
+ !context->isTranslationUnit();
+ context = context->getParent()) {
+ if (NamespaceDecl* decl = dyn_cast<NamespaceDecl>(context)) {
+ if (options_.checked_namespaces.find(decl->getNameAsString()) !=
+ options_.checked_namespaces.end()) {
+ return true;
+ }
+ }
}
return false;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698