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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « tools/clang/OWNERS ('k') | tools/clang/blink_gc_plugin/BlinkGCPluginConsumer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // This clang plugin checks various invariants of the Blink garbage
6 // collection infrastructure.
7 //
8 // Errors are described at:
9 // http://www.chromium.org/developers/blink-gc-plugin-errors
10
11 #include "BlinkGCPluginConsumer.h"
12 #include "BlinkGCPluginOptions.h"
13 #include "Config.h"
14
15 #include "clang/Frontend/CompilerInstance.h"
16 #include "clang/Frontend/FrontendPluginRegistry.h"
17
18 using namespace clang;
19
20 class BlinkGCPluginAction : public PluginASTAction {
21 public:
22 BlinkGCPluginAction() {}
23
24 protected:
25 // Overridden from PluginASTAction:
26 virtual std::unique_ptr<ASTConsumer> CreateASTConsumer(
27 CompilerInstance& instance,
28 llvm::StringRef ref) {
29 return llvm::make_unique<BlinkGCPluginConsumer>(instance, options_);
30 }
31
32 virtual bool ParseArgs(const CompilerInstance& instance,
33 const std::vector<std::string>& args) {
34 bool parsed = true;
35
36 for (size_t i = 0; i < args.size() && parsed; ++i) {
37 if (args[i] == "enable-oilpan") {
38 options_.enable_oilpan = true;
39 } else if (args[i] == "dump-graph") {
40 options_.dump_graph = true;
41 } else if (args[i] == "warn-raw-ptr") {
42 options_.warn_raw_ptr = true;
43 } else if (args[i] == "warn-unneeded-finalizer") {
44 options_.warn_unneeded_finalizer = true;
45 } else {
46 parsed = false;
47 llvm::errs() << "Unknown blink-gc-plugin argument: " << args[i] << "\n";
48 }
49 }
50
51 return parsed;
52 }
53
54 private:
55 BlinkGCPluginOptions options_;
56 };
57
58 static FrontendPluginRegistry::Add<BlinkGCPluginAction> X(
59 "blink-gc-plugin",
60 "Check Blink GC invariants");
OLDNEW
« 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