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

Side by Side Diff: tools/clang/blink_gc_plugin/Config.h

Issue 430213003: Blink GC plugin: Require that fields are actually traced by the visitor and identify tracing of dep… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file defines the names used by GC infrastructure. 5 // This file defines the names used by GC infrastructure.
6 6
7 #ifndef TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ 7 #ifndef TOOLS_BLINK_GC_PLUGIN_CONFIG_H_
8 #define TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ 8 #define TOOLS_BLINK_GC_PLUGIN_CONFIG_H_
9 9
10 #include "clang/AST/AST.h" 10 #include "clang/AST/AST.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 return IsAnnotated(decl, "blink_gc_plugin_ignore"); 132 return IsAnnotated(decl, "blink_gc_plugin_ignore");
133 } 133 }
134 134
135 static bool IsIgnoreCycleAnnotated(clang::Decl* decl) { 135 static bool IsIgnoreCycleAnnotated(clang::Decl* decl) {
136 return IsAnnotated(decl, "blink_gc_plugin_ignore_cycle") || 136 return IsAnnotated(decl, "blink_gc_plugin_ignore_cycle") ||
137 IsIgnoreAnnotated(decl); 137 IsIgnoreAnnotated(decl);
138 } 138 }
139 139
140 static bool IsVisitor(const std::string& name) { return name == "Visitor"; } 140 static bool IsVisitor(const std::string& name) { return name == "Visitor"; }
141 141
142 static bool IsTraceMethod(clang::CXXMethodDecl* method, 142 static bool IsTraceMethod(clang::FunctionDecl* method,
143 bool* isTraceAfterDispatch = 0) { 143 bool* isTraceAfterDispatch = 0) {
144 if (method->getNumParams() != 1) 144 if (method->getNumParams() != 1)
145 return false; 145 return false;
146 146
147 const std::string& name = method->getNameAsString(); 147 const std::string& name = method->getNameAsString();
148 if (name != kTraceName && name != kTraceAfterDispatchName) 148 if (name != kTraceName && name != kTraceAfterDispatchName)
149 return false; 149 return false;
150 150
151 const clang::QualType& formal_type = method->getParamDecl(0)->getType(); 151 const clang::QualType& formal_type = method->getParamDecl(0)->getType();
152 if (!formal_type->isPointerType()) 152 if (!formal_type->isPointerType())
(...skipping 19 matching lines...) Expand all
172 } 172 }
173 173
174 static bool EndsWith(const std::string& str, const std::string& suffix) { 174 static bool EndsWith(const std::string& str, const std::string& suffix) {
175 if (suffix.size() > str.size()) 175 if (suffix.size() > str.size())
176 return false; 176 return false;
177 return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0; 177 return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0;
178 } 178 }
179 }; 179 };
180 180
181 #endif // TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ 181 #endif // TOOLS_BLINK_GC_PLUGIN_CONFIG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698