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

Side by Side Diff: tools/clang/BindMigrate/OldCallbackTransform.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
« no previous file with comments | « tools/clang/BindMigrate/Makefile ('k') | tools/clang/BindMigrate/OldCallbackTransform.cpp » ('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 (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_OLD_CALLBACK_TRANSFORM_H_
6 #define TOOL_CLANG_BINDMIGRATE_OLD_CALLBACK_TRANSFORM_H_
7
8 #include <set>
9 #include <string>
10
11 #include "Transform.h"
12
13 namespace clang {
14
15 class ASTContext;
16 class DiagnosticEmitter;
17 class Rewriter;
18
19 class OldCallbackTransform : public Transform {
20 public:
21 OldCallbackTransform(ASTContext* context,
22 Rewriter* rewriter,
23 DiagnosticEmitter* emitter);
24
25 // Transform Overrides.
26 virtual bool WouldTransformStmt(Stmt* statement);
27 virtual bool WouldTransformDecl(Decl* decl);
28 virtual void TransformStmt(Stmt *statement);
29 virtual void TransformDecl(Decl *decl);
30
31 private:
32 void RewriteIfOldCallbackGenerator(Stmt* statement);
33 void RewriteIfOldCallbackRun(Stmt* statement);
34 void RewriteTypedefIfOldCallback(TypedefDecl* tnd);
35 void RewriteVarIfOldCallback(VarDecl* vd);
36
37 bool CallbackFromType(QualType type, SourceLocation loc,
38 bool is_callback_with_return,
39 std::string* output);
40 bool CallbackFromVoidReturnType(QualType type, SourceLocation loc,
41 std::string* output);
42 bool CallbackFromTypeWithReturn(QualType type, SourceLocation loc,
43 std::string* output);
44 void ConvertTupleType(const TemplateArgumentList& template_args,
45 std::string* output);
46
47
48 bool IsOldCallbackType(QualType type, bool* is_callback_with_return);
49 bool IsOldCallbackGenerator(Stmt* statement);
50 bool IsOldCallbackRun(Stmt* statement);
51
52 ASTContext* context_;
53 Rewriter* rewriter_;
54 DiagnosticEmitter* error_emitter_;
55 };
56
57 } // namespace clang
58
59 #endif // TOOL_CLANG_BINDMIGRATE_OLD_CALLBACK_TRANSFORM_H_
OLDNEW
« no previous file with comments | « tools/clang/BindMigrate/Makefile ('k') | tools/clang/BindMigrate/OldCallbackTransform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698