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