OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // This clang plugin checks various invariants of the Blink garbage | 5 // This clang plugin checks various invariants of the Blink garbage |
6 // collection infrastructure. | 6 // collection infrastructure. |
7 // | 7 // |
8 // Errors are described at: | 8 // Errors are described at: |
9 // http://www.chromium.org/developers/blink-gc-plugin-errors | 9 // http://www.chromium.org/developers/blink-gc-plugin-errors |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 return llvm::make_unique<BlinkGCPluginConsumer>(instance, options_); | 28 return llvm::make_unique<BlinkGCPluginConsumer>(instance, options_); |
29 } | 29 } |
30 | 30 |
31 bool ParseArgs(const CompilerInstance&, | 31 bool ParseArgs(const CompilerInstance&, |
32 const std::vector<std::string>& args) override { | 32 const std::vector<std::string>& args) override { |
33 for (const auto& arg : args) { | 33 for (const auto& arg : args) { |
34 if (arg == "dump-graph") { | 34 if (arg == "dump-graph") { |
35 options_.dump_graph = true; | 35 options_.dump_graph = true; |
36 } else if (arg == "warn-unneeded-finalizer") { | 36 } else if (arg == "warn-unneeded-finalizer") { |
37 options_.warn_unneeded_finalizer = true; | 37 options_.warn_unneeded_finalizer = true; |
| 38 } else if (arg == "enable-weak-members-in-unmanaged-classes") { |
| 39 options_.enable_weak_members_in_unmanaged_classes = true; |
38 } else if (arg == "use-chromium-style-naming") { | 40 } else if (arg == "use-chromium-style-naming") { |
39 // TODO(dcheng): Remove this once the build no longer passes this flag. | 41 // TODO(dcheng): Remove this once the build no longer passes this flag. |
40 } else { | 42 } else { |
41 llvm::errs() << "Unknown blink-gc-plugin argument: " << arg << "\n"; | 43 llvm::errs() << "Unknown blink-gc-plugin argument: " << arg << "\n"; |
42 return false; | 44 return false; |
43 } | 45 } |
44 } | 46 } |
45 return true; | 47 return true; |
46 } | 48 } |
47 | 49 |
48 private: | 50 private: |
49 BlinkGCPluginOptions options_; | 51 BlinkGCPluginOptions options_; |
50 }; | 52 }; |
51 | 53 |
52 static FrontendPluginRegistry::Add<BlinkGCPluginAction> X( | 54 static FrontendPluginRegistry::Add<BlinkGCPluginAction> X( |
53 "blink-gc-plugin", | 55 "blink-gc-plugin", |
54 "Check Blink GC invariants"); | 56 "Check Blink GC invariants"); |
OLD | NEW |