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

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

Issue 592223002: Remove unused plugin argument to skip virtual method checks in .cc files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « tools/clang/plugins/FindBadConstructsAction.cpp ('k') | tools/clang/plugins/Options.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "FindBadConstructsConsumer.h" 5 #include "FindBadConstructsConsumer.h"
6 6
7 #include "clang/Frontend/CompilerInstance.h" 7 #include "clang/Frontend/CompilerInstance.h"
8 #include "clang/Lex/Lexer.h" 8 #include "clang/Lex/Lexer.h"
9 #include "llvm/Support/raw_ostream.h" 9 #include "llvm/Support/raw_ostream.h"
10 10
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 void FindBadConstructsConsumer::CheckChromeClass(SourceLocation record_location, 94 void FindBadConstructsConsumer::CheckChromeClass(SourceLocation record_location,
95 CXXRecordDecl* record) { 95 CXXRecordDecl* record) {
96 bool implementation_file = InImplementationFile(record_location); 96 bool implementation_file = InImplementationFile(record_location);
97 97
98 if (!implementation_file) { 98 if (!implementation_file) {
99 // Only check for "heavy" constructors/destructors in header files; 99 // Only check for "heavy" constructors/destructors in header files;
100 // within implementation files, there is no performance cost. 100 // within implementation files, there is no performance cost.
101 CheckCtorDtorWeight(record_location, record); 101 CheckCtorDtorWeight(record_location, record);
102 } 102 }
103 103
104 if (!implementation_file || options_.check_virtuals_in_implementations) { 104 bool warn_on_inline_bodies = !implementation_file;
105 bool warn_on_inline_bodies = !implementation_file;
106 105
107 // Check that all virtual methods are marked accordingly with both 106 // Check that all virtual methods are marked accordingly with both
108 // virtual and OVERRIDE. 107 // virtual and OVERRIDE.
109 CheckVirtualMethods(record_location, record, warn_on_inline_bodies); 108 CheckVirtualMethods(record_location, record, warn_on_inline_bodies);
110 }
111 109
112 CheckRefCountedDtors(record_location, record); 110 CheckRefCountedDtors(record_location, record);
113 111
114 if (options_.check_weak_ptr_factory_order) 112 if (options_.check_weak_ptr_factory_order)
115 CheckWeakPtrFactoryMembers(record_location, record); 113 CheckWeakPtrFactoryMembers(record_location, record);
116 } 114 }
117 115
118 void FindBadConstructsConsumer::CheckChromeEnum(SourceLocation enum_location, 116 void FindBadConstructsConsumer::CheckChromeEnum(SourceLocation enum_location,
119 EnumDecl* enum_decl) { 117 EnumDecl* enum_decl) {
120 if (!options_.check_enum_last_value) 118 if (!options_.check_enum_last_value)
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 record->getTypeForDecl()->getAsCXXRecordDecl()) { 676 record->getTypeForDecl()->getAsCXXRecordDecl()) {
679 weak_ptr_factory_location = iter->getLocation(); 677 weak_ptr_factory_location = iter->getLocation();
680 } 678 }
681 } 679 }
682 } 680 }
683 } 681 }
684 } 682 }
685 } 683 }
686 684
687 } // namespace chrome_checker 685 } // namespace chrome_checker
OLDNEW
« no previous file with comments | « tools/clang/plugins/FindBadConstructsAction.cpp ('k') | tools/clang/plugins/Options.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698