OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // A general interface for filtering and only acting on classes in Chromium C++ | 5 // A general interface for filtering and only acting on classes in Chromium C++ |
6 // code. | 6 // code. |
7 | 7 |
8 #include "ChromeClassTester.h" | 8 #include "ChromeClassTester.h" |
9 | 9 |
10 #include <sys/param.h> | 10 #include <sys/param.h> |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // non-pod class member. Probably harmless. | 193 // non-pod class member. Probably harmless. |
194 ignored_record_names_.insert("MockTransaction"); | 194 ignored_record_names_.insert("MockTransaction"); |
195 | 195 |
196 // Used heavily in ui_unittests and once in views_unittests. Fixing this | 196 // Used heavily in ui_unittests and once in views_unittests. Fixing this |
197 // isn't worth the overhead of an additional library. | 197 // isn't worth the overhead of an additional library. |
198 ignored_record_names_.insert("TestAnimationDelegate"); | 198 ignored_record_names_.insert("TestAnimationDelegate"); |
199 | 199 |
200 // Part of our public interface that nacl and friends use. (Arguably, this | 200 // Part of our public interface that nacl and friends use. (Arguably, this |
201 // should mean that this is a higher priority but fixing this looks hard.) | 201 // should mean that this is a higher priority but fixing this looks hard.) |
202 ignored_record_names_.insert("PluginVersionInfo"); | 202 ignored_record_names_.insert("PluginVersionInfo"); |
| 203 |
| 204 // Measured performance improvement on cc_perftests. See |
| 205 // https://codereview.chromium.org/11299290/ |
| 206 ignored_record_names_.insert("QuadF"); |
203 } | 207 } |
204 | 208 |
205 std::string ChromeClassTester::GetNamespaceImpl(const DeclContext* context, | 209 std::string ChromeClassTester::GetNamespaceImpl(const DeclContext* context, |
206 const std::string& candidate) { | 210 const std::string& candidate) { |
207 switch (context->getDeclKind()) { | 211 switch (context->getDeclKind()) { |
208 case Decl::TranslationUnit: { | 212 case Decl::TranslationUnit: { |
209 return candidate; | 213 return candidate; |
210 } | 214 } |
211 case Decl::Namespace: { | 215 case Decl::Namespace: { |
212 const NamespaceDecl* decl = dyn_cast<NamespaceDecl>(context); | 216 const NamespaceDecl* decl = dyn_cast<NamespaceDecl>(context); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 PresumedLoc ploc = source_manager.getPresumedLoc(spelling_location); | 290 PresumedLoc ploc = source_manager.getPresumedLoc(spelling_location); |
287 if (ploc.isInvalid()) { | 291 if (ploc.isInvalid()) { |
288 // If we're in an invalid location, we're looking at things that aren't | 292 // If we're in an invalid location, we're looking at things that aren't |
289 // actually stated in the source. | 293 // actually stated in the source. |
290 return false; | 294 return false; |
291 } | 295 } |
292 | 296 |
293 *filename = ploc.getFilename(); | 297 *filename = ploc.getFilename(); |
294 return true; | 298 return true; |
295 } | 299 } |
OLD | NEW |