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

Side by Side Diff: tools/clang/BindMigrate/PostTaskTransform.h

Issue 7886056: Clang plugin that rewrites PostTask(_, NewRunnableMethod(...)) to PostTask(_, base::Bind(...)); (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix lifetime issue where BindMigrateAction is deleted before the ASTConsumer is finished. Created 9 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 #ifndef TOOL_CLANG_BINDMIGRATE_POST_TASK_TRANSFORM_H_
6 #define TOOL_CLANG_BINDMIGRATE_POST_TASK_TRANSFORM_H_
7
8 #include <set>
9 #include <string>
10
11 #include "Transform.h"
12
13 namespace clang {
14
15 class ASTContext;
16 class CXXMemberCallExpr;
17 class DiagnosticEmitter;
18 class Exprt;
19 class Rewriter;
20
21 class PostTaskTransform : public Transform {
22 public:
23 PostTaskTransform(ASTContext* context,
24 Rewriter* rewriter,
25 DiagnosticEmitter* emitter);
26
27 // Transform Overrides.
28 virtual bool WouldTransformStmt(Stmt* statement);
29 virtual void TransformStmt(Stmt* statement);
30
31 private:
32 bool IsPostTaskNRMExpr(Stmt* statement);
33 bool IsRefcountedType(QualType type);
34 bool RewriteIfNewRunnableSomething(Expr* post_task_arg);
35
36 ASTContext* context_;
37 Rewriter* rewriter_;
38 DiagnosticEmitter* error_emitter_;
39
40 // Names for matching.
41 std::set<std::string> interesting_classes_;
42 };
43
44 } // namespace clang
45
46 #endif // TOOL_CLANG_BINDMIGRATE_POST_TASK_TRANSFORM_H_
OLDNEW
« no previous file with comments | « tools/clang/BindMigrate/OldCallbackTransform.cpp ('k') | tools/clang/BindMigrate/PostTaskTransform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698