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 #include "FindBadConstructsAction.h" | 5 #include "FindBadConstructsAction.h" |
6 | 6 |
7 #include "clang/AST/ASTConsumer.h" | 7 #include "clang/AST/ASTConsumer.h" |
8 #include "clang/Frontend/FrontendPluginRegistry.h" | 8 #include "clang/Frontend/FrontendPluginRegistry.h" |
9 | 9 |
10 #include "FindBadConstructsConsumer.h" | 10 #include "FindBadConstructsConsumer.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 } | 42 } |
43 | 43 |
44 bool FindBadConstructsAction::ParseArgs(const CompilerInstance& instance, | 44 bool FindBadConstructsAction::ParseArgs(const CompilerInstance& instance, |
45 const std::vector<std::string>& args) { | 45 const std::vector<std::string>& args) { |
46 bool parsed = true; | 46 bool parsed = true; |
47 | 47 |
48 for (size_t i = 0; i < args.size() && parsed; ++i) { | 48 for (size_t i = 0; i < args.size() && parsed; ++i) { |
49 if (args[i] == "check-base-classes") { | 49 if (args[i] == "check-base-classes") { |
50 // TODO(rsleevi): Remove this once http://crbug.com/123295 is fixed. | 50 // TODO(rsleevi): Remove this once http://crbug.com/123295 is fixed. |
51 options_.check_base_classes = true; | 51 options_.check_base_classes = true; |
52 } else if (args[i] == "check-weak-ptr-factory-order") { | |
53 // TODO(dmichael): Remove this once http://crbug.com/303818 is fixed. | |
54 options_.check_weak_ptr_factory_order = true; | |
55 } else if (args[i] == "check-enum-last-value") { | 52 } else if (args[i] == "check-enum-last-value") { |
56 // TODO(tsepez): Enable this by default once http://crbug.com/356815 | 53 // TODO(tsepez): Enable this by default once http://crbug.com/356815 |
57 // and http://crbug.com/356816 are fixed. | 54 // and http://crbug.com/356816 are fixed. |
58 options_.check_enum_last_value = true; | 55 options_.check_enum_last_value = true; |
59 } else if (args[i] == "strict-virtual-specifiers") { | 56 } else if (args[i] == "strict-virtual-specifiers") { |
60 options_.strict_virtual_specifiers = true; | 57 options_.strict_virtual_specifiers = true; |
61 } else if (args[i] == "with-ast-visitor") { | 58 } else if (args[i] == "with-ast-visitor") { |
62 options_.with_ast_visitor = true; | 59 options_.with_ast_visitor = true; |
| 60 } else if (args[i] == "check-templates") { |
| 61 options_.check_templates = true; |
63 } else { | 62 } else { |
64 parsed = false; | 63 parsed = false; |
65 llvm::errs() << "Unknown clang plugin argument: " << args[i] << "\n"; | 64 llvm::errs() << "Unknown clang plugin argument: " << args[i] << "\n"; |
66 } | 65 } |
67 } | 66 } |
68 | 67 |
69 return parsed; | 68 return parsed; |
70 } | 69 } |
71 | 70 |
72 } // namespace chrome_checker | 71 } // namespace chrome_checker |
73 | 72 |
74 static FrontendPluginRegistry::Add<chrome_checker::FindBadConstructsAction> X( | 73 static FrontendPluginRegistry::Add<chrome_checker::FindBadConstructsAction> X( |
75 "find-bad-constructs", | 74 "find-bad-constructs", |
76 "Finds bad C++ constructs"); | 75 "Finds bad C++ constructs"); |
OLD | NEW |