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

Unified Diff: tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp

Issue 1385193002: Bisect clang Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 246985 Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/clang/OWNERS ('k') | tools/clang/blink_gc_plugin/BlinkGCPluginConsumer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
diff --git a/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp b/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..b8d0a44573f8204284f0be5518308dbb0bfd89b4
--- /dev/null
+++ b/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
@@ -0,0 +1,60 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This clang plugin checks various invariants of the Blink garbage
+// collection infrastructure.
+//
+// Errors are described at:
+// http://www.chromium.org/developers/blink-gc-plugin-errors
+
+#include "BlinkGCPluginConsumer.h"
+#include "BlinkGCPluginOptions.h"
+#include "Config.h"
+
+#include "clang/Frontend/CompilerInstance.h"
+#include "clang/Frontend/FrontendPluginRegistry.h"
+
+using namespace clang;
+
+class BlinkGCPluginAction : public PluginASTAction {
+ public:
+ BlinkGCPluginAction() {}
+
+ protected:
+ // Overridden from PluginASTAction:
+ virtual std::unique_ptr<ASTConsumer> CreateASTConsumer(
+ CompilerInstance& instance,
+ llvm::StringRef ref) {
+ return llvm::make_unique<BlinkGCPluginConsumer>(instance, options_);
+ }
+
+ virtual bool ParseArgs(const CompilerInstance& instance,
+ const std::vector<std::string>& args) {
+ bool parsed = true;
+
+ for (size_t i = 0; i < args.size() && parsed; ++i) {
+ if (args[i] == "enable-oilpan") {
+ options_.enable_oilpan = true;
+ } else if (args[i] == "dump-graph") {
+ options_.dump_graph = true;
+ } else if (args[i] == "warn-raw-ptr") {
+ options_.warn_raw_ptr = true;
+ } else if (args[i] == "warn-unneeded-finalizer") {
+ options_.warn_unneeded_finalizer = true;
+ } else {
+ parsed = false;
+ llvm::errs() << "Unknown blink-gc-plugin argument: " << args[i] << "\n";
+ }
+ }
+
+ return parsed;
+ }
+
+ private:
+ BlinkGCPluginOptions options_;
+};
+
+static FrontendPluginRegistry::Add<BlinkGCPluginAction> X(
+ "blink-gc-plugin",
+ "Check Blink GC invariants");
« no previous file with comments | « tools/clang/OWNERS ('k') | tools/clang/blink_gc_plugin/BlinkGCPluginConsumer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698