[cfe-dev] RFC: Formatting replacements in clang-replace

Manuel Klimek klimek at google.com
Mon Sep 2 11:43:42 PDT 2013


Sounds good.


On Fri, Aug 30, 2013 at 8:35 PM, Vane, Edwin <edwin.vane at intel.com> wrote:

> Hi all,
>
> The C++11 Migrator currently has the functionality to track changes made
> to files and then use libclangFormat to reformat the changed code. I want
> to get people's feedback on moving this functionality into clang-replace
> (or whatever is decided to name this tool). Let me provide some motivation.
>
> The next step for the migrator is process-based parallelism to speed up
> migration of code bases. The plan is a branch-and-gather approach: spawn
> multiple migrator processes to apply a single transform to multiple files.
> Each migrator process spits out serialized replacements. All serialized
> replacements are gathered in a single merge, deduplication, conflict
> detection, and application process: clang-replace. Then the next transform
> is applied in parallel. Due to the parallelism, the tracking of which parts
> of each file were changed is lost when clang-replace terminates. Clearly
> one option is to make the change tracking info persistent between
> executions of clang-replace. A simpler option, however, is to simply
> reformat changes every time clang-replace runs since knowledge of changed
> source ranges is known at this point.
>
> Reformatting wouldn't be necessary and could just be activated with a
> command-line switch if necessary.
>
> Beyond the migrator, affording the ability to reformat code after
> replacements are applied might be generally useful to other users of
> clang-replace. What say you all?
>
> --
> Edwin Vane
>   Software Developer
>   Intel of Canada, Inc.
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130902/3f615bf4/attachment.html>


More information about the cfe-dev mailing list