Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp

Issue 641353002: Blink GC plugin: Don't check conditions on invalid compilation units. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/clang/blink_gc_plugin/tests/crash_on_invalid.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 843 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 DiagnosticsEngine::Note, kBaseRequiresFinalizationNote); 854 DiagnosticsEngine::Note, kBaseRequiresFinalizationNote);
855 diag_field_requires_finalization_note_ = diagnostic_.getCustomDiagID( 855 diag_field_requires_finalization_note_ = diagnostic_.getCustomDiagID(
856 DiagnosticsEngine::Note, kFieldRequiresFinalizationNote); 856 DiagnosticsEngine::Note, kFieldRequiresFinalizationNote);
857 diag_overridden_non_virtual_trace_note_ = diagnostic_.getCustomDiagID( 857 diag_overridden_non_virtual_trace_note_ = diagnostic_.getCustomDiagID(
858 DiagnosticsEngine::Note, kOverriddenNonVirtualTraceNote); 858 DiagnosticsEngine::Note, kOverriddenNonVirtualTraceNote);
859 diag_manual_dispatch_method_note_ = diagnostic_.getCustomDiagID( 859 diag_manual_dispatch_method_note_ = diagnostic_.getCustomDiagID(
860 DiagnosticsEngine::Note, kManualDispatchMethodNote); 860 DiagnosticsEngine::Note, kManualDispatchMethodNote);
861 } 861 }
862 862
863 void HandleTranslationUnit(ASTContext& context) override { 863 void HandleTranslationUnit(ASTContext& context) override {
864 // Don't run the plugin if the compilation unit is already invalid.
865 if (diagnostic_.hasErrorOccurred())
866 return;
867
864 CollectVisitor visitor; 868 CollectVisitor visitor;
865 visitor.TraverseDecl(context.getTranslationUnitDecl()); 869 visitor.TraverseDecl(context.getTranslationUnitDecl());
866 870
867 if (options_.dump_graph) { 871 if (options_.dump_graph) {
868 std::error_code err; 872 std::error_code err;
869 // TODO: Make createDefaultOutputFile or a shorter createOutputFile work. 873 // TODO: Make createDefaultOutputFile or a shorter createOutputFile work.
870 json_ = JsonWriter::from(instance_.createOutputFile( 874 json_ = JsonWriter::from(instance_.createOutputFile(
871 "", // OutputPath 875 "", // OutputPath
872 err, // Errors 876 err, // Errors
873 true, // Binary 877 true, // Binary
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after
1875 1879
1876 private: 1880 private:
1877 BlinkGCPluginOptions options_; 1881 BlinkGCPluginOptions options_;
1878 }; 1882 };
1879 1883
1880 } // namespace 1884 } // namespace
1881 1885
1882 static FrontendPluginRegistry::Add<BlinkGCPluginAction> X( 1886 static FrontendPluginRegistry::Add<BlinkGCPluginAction> X(
1883 "blink-gc-plugin", 1887 "blink-gc-plugin",
1884 "Check Blink GC invariants"); 1888 "Check Blink GC invariants");
OLDNEW
« no previous file with comments | « no previous file | tools/clang/blink_gc_plugin/tests/crash_on_invalid.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698