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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } else if (args[i] == "enforce-in-pdf") { | 50 } else if (args[i] == "enforce-in-pdf") { |
51 // TODO(thestig): This is now always on. Remove support for this flag once | 51 // TODO(thestig): This is now always on. Remove support for this flag once |
52 // the build no longer passes it in. | 52 // the build no longer passes it in. |
53 } else if (args[i] == "enforce-in-thirdparty-webkit") { | 53 } else if (args[i] == "enforce-in-thirdparty-webkit") { |
54 options_.enforce_in_thirdparty_webkit = true; | 54 options_.enforce_in_thirdparty_webkit = true; |
55 } else if (args[i] == "check-enum-last-value") { | 55 } else if (args[i] == "check-enum-last-value") { |
56 // TODO(tsepez): Enable this by default once http://crbug.com/356815 | 56 // TODO(tsepez): Enable this by default once http://crbug.com/356815 |
57 // and http://crbug.com/356816 are fixed. | 57 // and http://crbug.com/356816 are fixed. |
58 options_.check_enum_last_value = true; | 58 options_.check_enum_last_value = true; |
59 } else if (args[i] == "check-templates") { | 59 } else if (args[i] == "check-templates") { |
60 options_.check_templates = true; | 60 // TODO(thakis): This is now always on. Remove support for this flag once |
| 61 // the build no longer passes it in. |
61 } else if (args[i] == "follow-macro-expansion") { | 62 } else if (args[i] == "follow-macro-expansion") { |
62 // TODO(thakis): This is now always on. Remove support for this flag once | 63 // TODO(thakis): This is now always on. Remove support for this flag once |
63 // the build no longer passes it in. | 64 // the build no longer passes it in. |
64 } else if (args[i] == "no-realpath") { | 65 } else if (args[i] == "no-realpath") { |
65 options_.no_realpath = true; | 66 options_.no_realpath = true; |
66 } else if (args[i] == "check-ipc") { | 67 } else if (args[i] == "check-ipc") { |
67 options_.check_ipc = true; | 68 options_.check_ipc = true; |
68 } else if (args[i] == "check-auto-raw-pointer") { | 69 } else if (args[i] == "check-auto-raw-pointer") { |
69 options_.check_auto_raw_pointer = true; | 70 options_.check_auto_raw_pointer = true; |
70 } else if (args[i] == "check-implicit-copy-ctors") { | 71 } else if (args[i] == "check-implicit-copy-ctors") { |
71 // This is deprecated and will be removed once the flag is not used. | 72 // This is deprecated and will be removed once the flag is not used. |
72 } else { | 73 } else { |
73 parsed = false; | 74 parsed = false; |
74 llvm::errs() << "Unknown clang plugin argument: " << args[i] << "\n"; | 75 llvm::errs() << "Unknown clang plugin argument: " << args[i] << "\n"; |
75 } | 76 } |
76 } | 77 } |
77 | 78 |
78 return parsed; | 79 return parsed; |
79 } | 80 } |
80 | 81 |
81 } // namespace chrome_checker | 82 } // namespace chrome_checker |
82 | 83 |
83 static FrontendPluginRegistry::Add<chrome_checker::FindBadConstructsAction> X( | 84 static FrontendPluginRegistry::Add<chrome_checker::FindBadConstructsAction> X( |
84 "find-bad-constructs", | 85 "find-bad-constructs", |
85 "Finds bad C++ constructs"); | 86 "Finds bad C++ constructs"); |
OLD | NEW |