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

Side by Side Diff: tools/clang/plugins/FindBadConstructsConsumer.h

Issue 2780113002: Refactor banned directory checking so Blink can opt into certain checks. (Closed)
Patch Set: better enum names Created 3 years, 8 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
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 void Traverse(clang::ASTContext& context); 49 void Traverse(clang::ASTContext& context);
50 50
51 // RecursiveASTVisitor: 51 // RecursiveASTVisitor:
52 bool TraverseDecl(clang::Decl* decl); 52 bool TraverseDecl(clang::Decl* decl);
53 bool VisitTagDecl(clang::TagDecl* tag_decl); 53 bool VisitTagDecl(clang::TagDecl* tag_decl);
54 bool VisitVarDecl(clang::VarDecl* var_decl); 54 bool VisitVarDecl(clang::VarDecl* var_decl);
55 bool VisitTemplateSpecializationType(clang::TemplateSpecializationType* spec); 55 bool VisitTemplateSpecializationType(clang::TemplateSpecializationType* spec);
56 bool VisitCallExpr(clang::CallExpr* call_expr); 56 bool VisitCallExpr(clang::CallExpr* call_expr);
57 57
58 // ChromeClassTester overrides: 58 // ChromeClassTester overrides:
59 void CheckChromeClass(clang::SourceLocation record_location, 59 void CheckChromeClass(LocationType location_type,
60 clang::SourceLocation record_location,
60 clang::CXXRecordDecl* record) override; 61 clang::CXXRecordDecl* record) override;
61 void CheckChromeEnum(clang::SourceLocation enum_location, 62 void CheckChromeEnum(LocationType location_type,
63 clang::SourceLocation enum_location,
62 clang::EnumDecl* enum_decl) override; 64 clang::EnumDecl* enum_decl) override;
63 65
64 private: 66 private:
65 // The type of problematic ref-counting pattern that was encountered. 67 // The type of problematic ref-counting pattern that was encountered.
66 enum RefcountIssue { None, ImplicitDestructor, PublicDestructor }; 68 enum RefcountIssue { None, ImplicitDestructor, PublicDestructor };
67 69
68 void CheckCtorDtorWeight(clang::SourceLocation record_location, 70 void CheckCtorDtorWeight(clang::SourceLocation record_location,
69 clang::CXXRecordDecl* record); 71 clang::CXXRecordDecl* record);
70 72
71 bool InTestingNamespace(const clang::Decl* record); 73 bool InTestingNamespace(const clang::Decl* record);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 unsigned diag_note_implicit_dtor_; 125 unsigned diag_note_implicit_dtor_;
124 unsigned diag_note_public_dtor_; 126 unsigned diag_note_public_dtor_;
125 unsigned diag_note_protected_non_virtual_dtor_; 127 unsigned diag_note_protected_non_virtual_dtor_;
126 128
127 std::unique_ptr<CheckIPCVisitor> ipc_visitor_; 129 std::unique_ptr<CheckIPCVisitor> ipc_visitor_;
128 }; 130 };
129 131
130 } // namespace chrome_checker 132 } // namespace chrome_checker
131 133
132 #endif // TOOLS_CLANG_PLUGINS_FINDBADCONSTRUCTSCONSUMER_H_ 134 #endif // TOOLS_CLANG_PLUGINS_FINDBADCONSTRUCTSCONSUMER_H_
OLDNEW
« no previous file with comments | « tools/clang/plugins/ChromeClassTester.cpp ('k') | tools/clang/plugins/FindBadConstructsConsumer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698