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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // Returns a diagnostic builder that only emits the diagnostic if the spelling | 65 // Returns a diagnostic builder that only emits the diagnostic if the spelling |
66 // location (the actual characters that make up the token) is not in an | 66 // location (the actual characters that make up the token) is not in an |
67 // ignored file. This is useful for situations where the token might originate | 67 // ignored file. This is useful for situations where the token might originate |
68 // from a macro in a system header: warning isn't useful, since system headers | 68 // from a macro in a system header: warning isn't useful, since system headers |
69 // generally can't be easily updated. | 69 // generally can't be easily updated. |
70 SuppressibleDiagnosticBuilder ReportIfSpellingLocNotIgnored( | 70 SuppressibleDiagnosticBuilder ReportIfSpellingLocNotIgnored( |
71 clang::SourceLocation loc, | 71 clang::SourceLocation loc, |
72 unsigned diagnostic_id); | 72 unsigned diagnostic_id); |
73 | 73 |
74 void CheckVirtualMethods(clang::SourceLocation record_location, | 74 void CheckVirtualMethods(clang::SourceLocation record_location, |
75 clang::CXXRecordDecl* record, | 75 clang::CXXRecordDecl* record); |
76 bool warn_on_inline_bodies); | |
77 void CheckVirtualSpecifiers(const clang::CXXMethodDecl* method); | 76 void CheckVirtualSpecifiers(const clang::CXXMethodDecl* method); |
78 void CheckVirtualBodies(const clang::CXXMethodDecl* method); | |
79 | 77 |
80 void CountType(const clang::Type* type, | 78 void CountType(const clang::Type* type, |
81 int* trivial_member, | 79 int* trivial_member, |
82 int* non_trivial_member, | 80 int* non_trivial_member, |
83 int* templated_non_trivial_member); | 81 int* templated_non_trivial_member); |
84 | 82 |
85 static RefcountIssue CheckRecordForRefcountIssue( | 83 static RefcountIssue CheckRecordForRefcountIssue( |
86 const clang::CXXRecordDecl* record, | 84 const clang::CXXRecordDecl* record, |
87 clang::SourceLocation& loc); | 85 clang::SourceLocation& loc); |
88 bool IsRefCounted(const clang::CXXBaseSpecifier* base, | 86 bool IsRefCounted(const clang::CXXBaseSpecifier* base, |
(...skipping 19 matching lines...) Expand all Loading... |
108 unsigned diag_bad_enum_last_value_; | 106 unsigned diag_bad_enum_last_value_; |
109 unsigned diag_note_inheritance_; | 107 unsigned diag_note_inheritance_; |
110 unsigned diag_note_implicit_dtor_; | 108 unsigned diag_note_implicit_dtor_; |
111 unsigned diag_note_public_dtor_; | 109 unsigned diag_note_public_dtor_; |
112 unsigned diag_note_protected_non_virtual_dtor_; | 110 unsigned diag_note_protected_non_virtual_dtor_; |
113 }; | 111 }; |
114 | 112 |
115 } // namespace chrome_checker | 113 } // namespace chrome_checker |
116 | 114 |
117 #endif // TOOLS_CLANG_PLUGINS_FINDBADCONSTRUCTSCONSUMER_H_ | 115 #endif // TOOLS_CLANG_PLUGINS_FINDBADCONSTRUCTSCONSUMER_H_ |
OLD | NEW |