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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 // garbage collection infrastructure. | 567 // garbage collection infrastructure. |
568 class BlinkGCPluginConsumer : public ASTConsumer { | 568 class BlinkGCPluginConsumer : public ASTConsumer { |
569 public: | 569 public: |
570 BlinkGCPluginConsumer(CompilerInstance& instance, | 570 BlinkGCPluginConsumer(CompilerInstance& instance, |
571 const BlinkGCPluginOptions& options) | 571 const BlinkGCPluginOptions& options) |
572 : instance_(instance), | 572 : instance_(instance), |
573 diagnostic_(instance.getDiagnostics()), | 573 diagnostic_(instance.getDiagnostics()), |
574 options_(options), | 574 options_(options), |
575 json_(0) { | 575 json_(0) { |
576 | 576 |
577 // Only check structures in the blink, WebCore and WebKit namespaces. | 577 // Only check structures in the blink, blink and WebKit namespaces. |
578 options_.checked_namespaces.insert("blink"); | 578 options_.checked_namespaces.insert("blink"); |
579 options_.checked_namespaces.insert("WebCore"); | 579 options_.checked_namespaces.insert("blink"); |
580 options_.checked_namespaces.insert("WebKit"); | 580 options_.checked_namespaces.insert("WebKit"); |
581 | 581 |
582 // Ignore GC implementation files. | 582 // Ignore GC implementation files. |
583 options_.ignored_directories.push_back("/heap/"); | 583 options_.ignored_directories.push_back("/heap/"); |
584 | 584 |
585 // Register warning/error messages. | 585 // Register warning/error messages. |
586 diag_class_must_left_mostly_derive_gc_ = diagnostic_.getCustomDiagID( | 586 diag_class_must_left_mostly_derive_gc_ = diagnostic_.getCustomDiagID( |
587 getErrorLevel(), kClassMustLeftMostlyDeriveGC); | 587 getErrorLevel(), kClassMustLeftMostlyDeriveGC); |
588 diag_class_requires_trace_method_ = | 588 diag_class_requires_trace_method_ = |
589 diagnostic_.getCustomDiagID(getErrorLevel(), kClassRequiresTraceMethod); | 589 diagnostic_.getCustomDiagID(getErrorLevel(), kClassRequiresTraceMethod); |
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 | 1477 |
1478 private: | 1478 private: |
1479 BlinkGCPluginOptions options_; | 1479 BlinkGCPluginOptions options_; |
1480 }; | 1480 }; |
1481 | 1481 |
1482 } // namespace | 1482 } // namespace |
1483 | 1483 |
1484 static FrontendPluginRegistry::Add<BlinkGCPluginAction> X( | 1484 static FrontendPluginRegistry::Add<BlinkGCPluginAction> X( |
1485 "blink-gc-plugin", | 1485 "blink-gc-plugin", |
1486 "Check Blink GC invariants"); | 1486 "Check Blink GC invariants"); |
OLD | NEW |