Index: tools/clang/blink_gc_plugin/Config.cpp |
diff --git a/tools/clang/blink_gc_plugin/Config.cpp b/tools/clang/blink_gc_plugin/Config.cpp |
index fa00782cc6b79f2c81d15840f1ea24ef36aebca6..1ec3c78d12c48c5496bc6601346116d92a9237fe 100644 |
--- a/tools/clang/blink_gc_plugin/Config.cpp |
+++ b/tools/clang/blink_gc_plugin/Config.cpp |
@@ -49,6 +49,18 @@ void Config::UseLegacyNames() { |
kIsHeapObjectAliveName = legacy::kIsHeapObjectAliveName; |
} |
+bool Config::IsAnnotated(clang::Decl* decl, const std::string& anno) { |
+ if (!decl->hasAttrs()) |
+ return false; |
+ |
+ for (const clang::Attr* attr : decl->getAttrs()) { |
+ const clang::AnnotateAttr* annotation = dyn_cast<clang::AnnotateAttr>(attr); |
+ if (annotation && annotation->getAnnotation() == anno) |
+ return true; |
+ } |
+ return false; |
+} |
+ |
bool Config::IsTemplateInstantiation(CXXRecordDecl* record) { |
ClassTemplateSpecializationDecl* spec = |
dyn_cast<clang::ClassTemplateSpecializationDecl>(record); |