| 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 // This file defines a bunch of recurring problems in the Chromium C++ code. | 5 // This file defines a bunch of recurring problems in the Chromium C++ code. |
| 6 // | 6 // |
| 7 // Checks that are implemented: | 7 // Checks that are implemented: |
| 8 // - Constructors/Destructors should not be inlined if they are of a complex | 8 // - Constructors/Destructors should not be inlined if they are of a complex |
| 9 // class type. | 9 // class type. |
| 10 // - Missing "virtual" keywords on methods that should be virtual. | 10 // - Missing "virtual" keywords on methods that should be virtual. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 bool InTestingNamespace(const clang::Decl* record); | 73 bool InTestingNamespace(const clang::Decl* record); |
| 74 bool IsMethodInBannedOrTestingNamespace(const clang::CXXMethodDecl* method); | 74 bool IsMethodInBannedOrTestingNamespace(const clang::CXXMethodDecl* method); |
| 75 | 75 |
| 76 // Returns a diagnostic builder that only emits the diagnostic if the spelling | 76 // Returns a diagnostic builder that only emits the diagnostic if the spelling |
| 77 // location (the actual characters that make up the token) is not in an | 77 // location (the actual characters that make up the token) is not in an |
| 78 // ignored file. This is useful for situations where the token might originate | 78 // ignored file. This is useful for situations where the token might originate |
| 79 // from a macro in a system header: warning isn't useful, since system headers | 79 // from a macro in a system header: warning isn't useful, since system headers |
| 80 // generally can't be easily updated. | 80 // generally can't be easily updated. |
| 81 SuppressibleDiagnosticBuilder ReportIfSpellingLocNotIgnored( | 81 SuppressibleDiagnosticBuilder ReportIfSpellingLocNotIgnored( |
| 82 clang::SourceLocation loc, | 82 clang::SourceLocation loc, |
| 83 const clang::Decl* record, |
| 83 unsigned diagnostic_id); | 84 unsigned diagnostic_id); |
| 84 | 85 |
| 85 void CheckVirtualMethods(clang::SourceLocation record_location, | 86 void CheckVirtualMethods(clang::SourceLocation record_location, |
| 86 clang::CXXRecordDecl* record, | 87 clang::CXXRecordDecl* record, |
| 87 bool warn_on_inline_bodies); | 88 bool warn_on_inline_bodies); |
| 88 void CheckVirtualSpecifiers(const clang::CXXMethodDecl* method); | 89 void CheckVirtualSpecifiers(const clang::CXXMethodDecl* method); |
| 89 void CheckVirtualBodies(const clang::CXXMethodDecl* method); | 90 void CheckVirtualBodies(const clang::CXXMethodDecl* method); |
| 90 | 91 |
| 91 void CountType(const clang::Type* type, | 92 void CountType(const clang::Type* type, |
| 92 int* trivial_member, | 93 int* trivial_member, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 unsigned diag_note_implicit_dtor_; | 126 unsigned diag_note_implicit_dtor_; |
| 126 unsigned diag_note_public_dtor_; | 127 unsigned diag_note_public_dtor_; |
| 127 unsigned diag_note_protected_non_virtual_dtor_; | 128 unsigned diag_note_protected_non_virtual_dtor_; |
| 128 | 129 |
| 129 std::unique_ptr<CheckIPCVisitor> ipc_visitor_; | 130 std::unique_ptr<CheckIPCVisitor> ipc_visitor_; |
| 130 }; | 131 }; |
| 131 | 132 |
| 132 } // namespace chrome_checker | 133 } // namespace chrome_checker |
| 133 | 134 |
| 134 #endif // TOOLS_CLANG_PLUGINS_FINDBADCONSTRUCTSCONSUMER_H_ | 135 #endif // TOOLS_CLANG_PLUGINS_FINDBADCONSTRUCTSCONSUMER_H_ |
| OLD | NEW |