OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 case Decl::TranslationUnit: { | 170 case Decl::TranslationUnit: { |
171 return candidate; | 171 return candidate; |
172 } | 172 } |
173 case Decl::Namespace: { | 173 case Decl::Namespace: { |
174 const NamespaceDecl* decl = dyn_cast<NamespaceDecl>(context); | 174 const NamespaceDecl* decl = dyn_cast<NamespaceDecl>(context); |
175 std::string name_str; | 175 std::string name_str; |
176 llvm::raw_string_ostream OS(name_str); | 176 llvm::raw_string_ostream OS(name_str); |
177 if (decl->isAnonymousNamespace()) | 177 if (decl->isAnonymousNamespace()) |
178 OS << "<anonymous namespace>"; | 178 OS << "<anonymous namespace>"; |
179 else | 179 else |
180 OS << decl; | 180 OS << *decl; |
181 return GetNamespaceImpl(context->getParent(), | 181 return GetNamespaceImpl(context->getParent(), |
182 OS.str()); | 182 OS.str()); |
183 } | 183 } |
184 default: { | 184 default: { |
185 return GetNamespaceImpl(context->getParent(), candidate); | 185 return GetNamespaceImpl(context->getParent(), candidate); |
186 } | 186 } |
187 } | 187 } |
188 } | 188 } |
189 | 189 |
190 bool ChromeClassTester::InBannedDirectory(SourceLocation loc) { | 190 bool ChromeClassTester::InBannedDirectory(SourceLocation loc) { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 } | 239 } |
240 } | 240 } |
241 } | 241 } |
242 | 242 |
243 return false; | 243 return false; |
244 } | 244 } |
245 | 245 |
246 bool ChromeClassTester::IsIgnoredType(const std::string& base_name) { | 246 bool ChromeClassTester::IsIgnoredType(const std::string& base_name) { |
247 return ignored_record_names_.find(base_name) != ignored_record_names_.end(); | 247 return ignored_record_names_.find(base_name) != ignored_record_names_.end(); |
248 } | 248 } |
OLD | NEW |