Chromium Code Reviews| 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 29 matching lines...) Expand all Loading... | |
| 40 } | 40 } | 
| 41 | 41 | 
| 42 bool FindBadConstructsAction::ParseArgs(const CompilerInstance& instance, | 42 bool FindBadConstructsAction::ParseArgs(const CompilerInstance& instance, | 
| 43 const std::vector<std::string>& args) { | 43 const std::vector<std::string>& args) { | 
| 44 bool parsed = true; | 44 bool parsed = true; | 
| 45 | 45 | 
| 46 for (size_t i = 0; i < args.size() && parsed; ++i) { | 46 for (size_t i = 0; i < args.size() && parsed; ++i) { | 
| 47 if (args[i] == "check-base-classes") { | 47 if (args[i] == "check-base-classes") { | 
| 48 // TODO(rsleevi): Remove this once http://crbug.com/123295 is fixed. | 48 // TODO(rsleevi): Remove this once http://crbug.com/123295 is fixed. | 
| 49 options_.check_base_classes = true; | 49 options_.check_base_classes = true; | 
| 50 } else if (args[i] == "enforce-in-pdf") { | |
| 51 // TODO(thestig): This is now always on. Remove support for this flag once | |
| 52 // the build no longer passes it in. | |
| 53 } else if (args[i] == "enforce-in-thirdparty-webkit") { | 50 } else if (args[i] == "enforce-in-thirdparty-webkit") { | 
| 54 options_.enforce_in_thirdparty_webkit = true; | 51 options_.enforce_in_thirdparty_webkit = 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] == "check-templates") { | 56 } else if (args[i] == "check-templates") { | 
| 60 // TODO(thakis): This is now always on. Remove support for this flag once | 57 // TODO(thakis): This is now always on. Remove support for this flag once | 
| 61 // the build no longer passes it in. | 58 // the build no longer passes it in. | 
| 
 
Nico
2016/08/31 17:37:58
If you have the branch around you made this CL on,
 
Lei Zhang
2016/08/31 18:12:54
Done.
 
 | |
| 62 } else if (args[i] == "follow-macro-expansion") { | 59 } else if (args[i] == "follow-macro-expansion") { | 
| 63 // TODO(thakis): This is now always on. Remove support for this flag once | 60 // TODO(thakis): This is now always on. Remove support for this flag once | 
| 64 // the build no longer passes it in. | 61 // the build no longer passes it in. | 
| 65 } else if (args[i] == "no-realpath") { | 62 } else if (args[i] == "no-realpath") { | 
| 66 options_.no_realpath = true; | 63 options_.no_realpath = true; | 
| 67 } else if (args[i] == "check-ipc") { | 64 } else if (args[i] == "check-ipc") { | 
| 68 options_.check_ipc = true; | 65 options_.check_ipc = true; | 
| 69 } else if (args[i] == "check-auto-raw-pointer") { | 66 } else if (args[i] == "check-auto-raw-pointer") { | 
| 70 options_.check_auto_raw_pointer = true; | 67 options_.check_auto_raw_pointer = true; | 
| 71 } else if (args[i] == "check-implicit-copy-ctors") { | 68 } else if (args[i] == "check-implicit-copy-ctors") { | 
| 72 // This is deprecated and will be removed once the flag is not used. | 69 // This is deprecated and will be removed once the flag is not used. | 
| 73 } else { | 70 } else { | 
| 74 parsed = false; | 71 parsed = false; | 
| 75 llvm::errs() << "Unknown clang plugin argument: " << args[i] << "\n"; | 72 llvm::errs() << "Unknown clang plugin argument: " << args[i] << "\n"; | 
| 76 } | 73 } | 
| 77 } | 74 } | 
| 78 | 75 | 
| 79 return parsed; | 76 return parsed; | 
| 80 } | 77 } | 
| 81 | 78 | 
| 82 } // namespace chrome_checker | 79 } // namespace chrome_checker | 
| 83 | 80 | 
| 84 static FrontendPluginRegistry::Add<chrome_checker::FindBadConstructsAction> X( | 81 static FrontendPluginRegistry::Add<chrome_checker::FindBadConstructsAction> X( | 
| 85 "find-bad-constructs", | 82 "find-bad-constructs", | 
| 86 "Finds bad C++ constructs"); | 83 "Finds bad C++ constructs"); | 
| OLD | NEW |