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

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

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/JsonWriter.h ('k') | tools/clang/blink_gc_plugin/process-graph.py » ('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 1a82206904cc32c4762dce91422e76749d1c4613..56d10248b0686c3cfbf60112f8166f1cd98e799f 100644
--- a/tools/clang/blink_gc_plugin/RecordInfo.cpp
+++ b/tools/clang/blink_gc_plugin/RecordInfo.cpp
@@ -5,8 +5,6 @@
#include "Config.h"
#include "RecordInfo.h"
-#include "clang/AST/Attr.h"
-
using namespace clang;
using std::string;
@@ -136,14 +134,9 @@ bool RecordInfo::IsGCAllocated() {
return IsGCDerived() || IsHeapAllocatedCollection();
}
-static bool IsAnnotated(Decl* decl, const string& anno) {
- AnnotateAttr* attr = decl->getAttr<AnnotateAttr>();
- return attr && (attr->getAnnotation() == anno);
-}
-
RecordInfo* RecordCache::Lookup(CXXRecordDecl* record) {
// Ignore classes annotated with the GC_PLUGIN_IGNORE macro.
- if (!record || IsAnnotated(record, "blink_gc_plugin_ignore"))
+ if (!record || Config::IsIgnoreAnnotated(record))
return 0;
Cache::iterator it = cache_.find(record);
if (it != cache_.end())
@@ -160,17 +153,17 @@ bool RecordInfo::IsStackAllocated() {
++it) {
if (it->second.info()->IsStackAllocated()) {
is_stack_allocated_ = kTrue;
- break;
+ return is_stack_allocated_;
}
}
for (CXXRecordDecl::method_iterator it = record_->method_begin();
it != record_->method_end();
++it) {
- if (it->getNameAsString() == kNewOperatorName) {
- if (it->isDeleted() && IsAnnotated(*it, "blink_stack_allocated")) {
- is_stack_allocated_ = kTrue;
- break;
- }
+ if (it->getNameAsString() == kNewOperatorName &&
+ it->isDeleted() &&
+ Config::IsStackAnnotated(*it)) {
+ is_stack_allocated_ = kTrue;
+ return is_stack_allocated_;
}
}
}
@@ -285,7 +278,7 @@ RecordInfo::Fields* RecordInfo::CollectFields() {
++it) {
FieldDecl* field = *it;
// Ignore fields annotated with the GC_PLUGIN_IGNORE macro.
- if (IsAnnotated(field, "blink_gc_plugin_ignore"))
+ if (Config::IsIgnoreAnnotated(field))
continue;
if (Edge* edge = CreateEdge(field->getType().getTypePtrOrNull())) {
fields->insert(std::make_pair(field, FieldPoint(field, edge)));
« no previous file with comments | « tools/clang/blink_gc_plugin/JsonWriter.h ('k') | tools/clang/blink_gc_plugin/process-graph.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698