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

Unified Diff: tools/clang/blink_gc_plugin/Config.h

Issue 207913002: Global cycle detection analysis. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments Created 6 years, 9 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/BlinkGCPlugin.cpp ('k') | tools/clang/blink_gc_plugin/Edge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/blink_gc_plugin/Config.h
diff --git a/tools/clang/blink_gc_plugin/Config.h b/tools/clang/blink_gc_plugin/Config.h
index 7354549457f8c89f21581edc76f5e02980d31206..533947002e95beb1488f4bcd5e439538e3ccb29f 100644
--- a/tools/clang/blink_gc_plugin/Config.h
+++ b/tools/clang/blink_gc_plugin/Config.h
@@ -8,6 +8,7 @@
#define TOOLS_BLINK_GC_PLUGIN_CONFIG_H_
#include "clang/AST/AST.h"
+#include "clang/AST/Attr.h"
const char kNewOperatorName[] = "operator new";
const char kCreateName[] = "create";
@@ -101,6 +102,24 @@ class Config {
IsGCMixinBase(name);
}
+ static bool IsAnnotated(clang::Decl* decl, const std::string& anno) {
+ clang::AnnotateAttr* attr = decl->getAttr<clang::AnnotateAttr>();
+ return attr && (attr->getAnnotation() == anno);
+ }
+
+ static bool IsStackAnnotated(clang::Decl* decl) {
+ return IsAnnotated(decl, "blink_stack_allocated");
+ }
+
+ static bool IsIgnoreAnnotated(clang::Decl* decl) {
+ return IsAnnotated(decl, "blink_gc_plugin_ignore");
+ }
+
+ static bool IsIgnoreCycleAnnotated(clang::Decl* decl) {
+ return IsAnnotated(decl, "blink_gc_plugin_ignore_cycle") ||
+ IsIgnoreAnnotated(decl);
+ }
+
static bool IsVisitor(const std::string& name) { return name == "Visitor"; }
static bool IsTraceMethod(clang::CXXMethodDecl* method,
« no previous file with comments | « tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp ('k') | tools/clang/blink_gc_plugin/Edge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698