| 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 19 matching lines...) Expand all Loading... |
| 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-stack-allocated-trace-method") { | 36 } else if (arg == "warn-stack-allocated-trace-method") { |
| 37 options_.warn_stack_allocated_trace_method = true; | 37 options_.warn_stack_allocated_trace_method = true; |
| 38 } else if (arg == "warn-unneeded-finalizer") { | 38 } else if (arg == "warn-unneeded-finalizer") { |
| 39 options_.warn_unneeded_finalizer = true; | 39 options_.warn_unneeded_finalizer = true; |
| 40 } else if (arg == "warn-unsafe-static-singletons") { |
| 41 options_.warn_singleton_with_scriptwrappables = true; |
| 40 } else if (arg == "use-chromium-style-naming") { | 42 } else if (arg == "use-chromium-style-naming") { |
| 41 options_.use_chromium_style_naming = true; | 43 options_.use_chromium_style_naming = true; |
| 42 } else { | 44 } else { |
| 43 llvm::errs() << "Unknown blink-gc-plugin argument: " << arg << "\n"; | 45 llvm::errs() << "Unknown blink-gc-plugin argument: " << arg << "\n"; |
| 44 return false; | 46 return false; |
| 45 } | 47 } |
| 46 } | 48 } |
| 47 return true; | 49 return true; |
| 48 } | 50 } |
| 49 | 51 |
| 50 private: | 52 private: |
| 51 BlinkGCPluginOptions options_; | 53 BlinkGCPluginOptions options_; |
| 52 }; | 54 }; |
| 53 | 55 |
| 54 static FrontendPluginRegistry::Add<BlinkGCPluginAction> X( | 56 static FrontendPluginRegistry::Add<BlinkGCPluginAction> X( |
| 55 "blink-gc-plugin", | 57 "blink-gc-plugin", |
| 56 "Check Blink GC invariants"); | 58 "Check Blink GC invariants"); |
| OLD | NEW |