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

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

Issue 133463002: Stub clang plugin to check consistency of the Blink GC infrastructure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reverted gyp setup restructuring Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/clang/blink_gc_plugin/Makefile » ('j') | tools/clang/scripts/update.sh » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 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 // Checks that are implemented:
9 // [currently none]
10
11 #include "clang/AST/AST.h"
12 #include "clang/AST/ASTConsumer.h"
13 #include "clang/Frontend/CompilerInstance.h"
14 #include "clang/Frontend/FrontendPluginRegistry.h"
15
16 using namespace clang;
17 using std::string;
18
19 namespace {
20
21 struct BlinkGCPluginOptions {
22 BlinkGCPluginOptions() {
23 }
24 };
25
26 // Main class containing checks for various invariants of the Blink
27 // garbage collection infrastructure.
28 class BlinkGCPluginConsumer : public ASTConsumer {
29 public:
30 BlinkGCPluginConsumer(CompilerInstance& instance,
31 const BlinkGCPluginOptions& options) {
32 }
33
34 virtual void HandleTranslationUnit(ASTContext& context) {
35 // FIXME: implement consistency checks.
36 }
37 };
38
39
40 class BlinkGCPluginAction : public PluginASTAction {
41 public:
42 BlinkGCPluginAction() {
43 }
44
45 protected:
46 // Overridden from PluginASTAction:
47 virtual ASTConsumer* CreateASTConsumer(CompilerInstance& instance,
48 llvm::StringRef ref) {
49 return new BlinkGCPluginConsumer(instance, options_);
50 }
51
52 virtual bool ParseArgs(const CompilerInstance& instance,
53 const std::vector<string>& args) {
54 bool parsed = true;
55
56 for (size_t i = 0; i < args.size() && parsed; ++i) {
57 parsed = false;
58 llvm::errs() << "Unknown blink-gc-plugin argument: " << args[i] << "\n";
59 }
60
61 return parsed;
62 }
63
64 private:
65 BlinkGCPluginOptions options_;
66 };
67
68 } // namespace
69
70 static FrontendPluginRegistry::Add<BlinkGCPluginAction>
71 X("blink-gc-plugin", "Check Blink GC invariants");
OLDNEW
« no previous file with comments | « no previous file | tools/clang/blink_gc_plugin/Makefile » ('j') | tools/clang/scripts/update.sh » ('J')

Powered by Google App Engine
This is Rietveld 408576698