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

Issue 7886056: Clang plugin that rewrites PostTask(_, NewRunnableMethod(...)) to PostTask(_, base::Bind(...)); (Closed)

Created:
9 years, 3 months ago by awong
Modified:
8 years, 6 months ago
Reviewers:
Nico
CC:
chromium-reviews, pam+watch_chromium.org, akalin, willchan no longer on Chromium, darin (slow to review)
Visibility:
Public.

Description

Clang plugin that rewrites PostTask(_, NewRunnableMethod(...)) to PostTask(_, base::Bind(...)); BUG=none TEST=none

Patch Set 1 #

Total comments: 14

Patch Set 2 : break into files and make saner #

Total comments: 6

Patch Set 3 : outputdir option implemented. #

Patch Set 4 : moar typesafe. #

Patch Set 5 : Migrate OldCallback. #

Patch Set 6 : Start with Transformer framework #

Patch Set 7 : Cleaner still #

Patch Set 8 : Fix lifetime issue where BindMigrateAction is deleted before the ASTConsumer is finished. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1769 lines, -0 lines) Patch
A tools/clang/BindMigrate/BindMigrate.exports View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
A tools/clang/BindMigrate/BindMigrateAction.cpp View 1 2 3 4 5 6 7 1 chunk +121 lines, -0 lines 0 comments Download
A tools/clang/BindMigrate/BindMigrateConsumer.h View 1 2 3 4 5 6 7 1 chunk +46 lines, -0 lines 0 comments Download
A tools/clang/BindMigrate/BindMigrateConsumer.cpp View 1 2 3 4 5 6 7 1 chunk +155 lines, -0 lines 0 comments Download
A tools/clang/BindMigrate/BindMigrateOptions.h View 1 2 3 4 5 6 1 chunk +26 lines, -0 lines 0 comments Download
A tools/clang/BindMigrate/CMakeLists.txt View 1 1 chunk +15 lines, -0 lines 0 comments Download
A tools/clang/BindMigrate/DiagnosticEmitter.h View 1 2 3 4 5 1 chunk +32 lines, -0 lines 0 comments Download
A tools/clang/BindMigrate/DiagnosticEmitter.cpp View 1 2 3 4 5 1 chunk +39 lines, -0 lines 0 comments Download
A tools/clang/BindMigrate/FileRemapper.h View 1 2 3 4 5 6 1 chunk +80 lines, -0 lines 0 comments Download
A tools/clang/BindMigrate/FileRemapper.cpp View 1 2 3 4 5 6 7 1 chunk +324 lines, -0 lines 0 comments Download
A tools/clang/BindMigrate/Makefile View 1 2 3 4 5 6 7 1 chunk +29 lines, -0 lines 0 comments Download
A tools/clang/BindMigrate/OldCallbackTransform.h View 1 2 3 4 5 1 chunk +59 lines, -0 lines 0 comments Download
A tools/clang/BindMigrate/OldCallbackTransform.cpp View 1 2 3 4 5 6 1 chunk +417 lines, -0 lines 0 comments Download
A tools/clang/BindMigrate/PostTaskTransform.h View 1 2 3 4 5 6 7 1 chunk +46 lines, -0 lines 0 comments Download
A tools/clang/BindMigrate/PostTaskTransform.cpp View 1 2 3 4 5 6 7 1 chunk +152 lines, -0 lines 0 comments Download
A tools/clang/BindMigrate/README.chromium View 1 1 chunk +19 lines, -0 lines 0 comments Download
A tools/clang/BindMigrate/Transform.h View 1 2 3 4 5 6 1 chunk +70 lines, -0 lines 0 comments Download
A tools/clang/BindMigrate/Transform.cpp View 1 2 3 4 5 6 1 chunk +99 lines, -0 lines 0 comments Download
A tools/clang/BindMigrate/Util.h View 1 2 3 4 5 6 1 chunk +17 lines, -0 lines 0 comments Download
A tools/clang/BindMigrate/Util.cpp View 1 2 3 4 5 6 1 chunk +19 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
awong
And here we start with the scary migration code... Nico, this is my first draft ...
9 years, 3 months ago (2011-09-15 02:22:44 UTC) #1
awong
Oh, and if you have any ideas about how to correctly re-indent the resulting code, ...
9 years, 3 months ago (2011-09-15 02:28:02 UTC) #2
Nico
This looks like a great start. For the relayout: Since all you do is replace ...
9 years, 3 months ago (2011-09-15 02:50:02 UTC) #3
awong
For the folks following along at home, draft #2. This is mainly just cleaning things ...
9 years, 3 months ago (2011-09-16 02:50:41 UTC) #4
Nico
:-) http://codereview.chromium.org/7886056/diff/6001/tools/clang/BindMigrate/BindMigrateAction.cpp File tools/clang/BindMigrate/BindMigrateAction.cpp (right): http://codereview.chromium.org/7886056/diff/6001/tools/clang/BindMigrate/BindMigrateAction.cpp#newcode56 tools/clang/BindMigrate/BindMigrateAction.cpp:56: arcmt_hack::FileRemapper remapper_; :-) If you find that any ...
9 years, 3 months ago (2011-09-16 03:00:54 UTC) #5
awong
http://codereview.chromium.org/7886056/diff/6001/tools/clang/BindMigrate/BindMigrateAction.cpp File tools/clang/BindMigrate/BindMigrateAction.cpp (right): http://codereview.chromium.org/7886056/diff/6001/tools/clang/BindMigrate/BindMigrateAction.cpp#newcode56 tools/clang/BindMigrate/BindMigrateAction.cpp:56: arcmt_hack::FileRemapper remapper_; On 2011/09/16 03:00:54, Nico wrote: > :-) ...
9 years, 3 months ago (2011-09-16 10:24:32 UTC) #6
awong
9 years, 3 months ago (2011-09-22 23:01:44 UTC) #7
If I keep at this, I'm going to have a generalized tool that I could try to
upstream into llvm. :-/

This is ready for a real review now.

There is 1 known bug, and 1 wanted feature.

Bug: I can't go from the TemplateArgument in OldCallbackTransform.cpp back to a
source location.  Thus, I'm relying on the pretty printer to regenerate the name
of the template argument.

The problem with this is that it can do weird formatting and insert unnecessary
namespaces.  If you have any ideas about how I can start from either the Stmt,
or the Decl, and get the Start/End Location for each individual template
parameter, that'd be awesome.

The feature I'm working on now is allowing you to restrict the run by type.

Will see how much patience I have :)

Powered by Google App Engine
This is Rietveld 408576698