~pali/llvm/clang-tools-extra-trunk

Viewing all changes in revision 1918.

  • Committer: hokein
  • Date: 2016-09-21 13:18:19 UTC
  • Revision ID: svn-v4:91177308-0d34-0410-b5e6-96231b3b80d8:clang-tools-extra/trunk:282070
[clang-move] A prototype tool for moving class definition to new file.

Summary:
This patch introduces a new tool which moves a specific class definition
from files (.h, .cc) to new files (.h, .cc), which mostly acts like
"Extract class defintion". In the long term, this tool should be
merged in to clang-refactoring as a subtool.

clang-move not only moves class definition, but also moves all the
forward declarations, functions defined in anonymous namespace and #include
headers to new files, to make sure the new files are compliable as much
as possible.

To move `Foo` from old.[h/cc] to new.[h/cc], use:

```
clang-move -name=Foo -old_header=old.h -old_cc=old.cc -new_header=new.h
-new_cc=new.cc old.cc
```

To move `Foo` from old.h to new.h, use:

```
clang-move -name=Foo -old_header=old.h -new_header=new.h old.cc
```

Reviewers: klimek, djasper, ioeric

Subscribers: mgorny, beanz, Eugene.Zelenko, bkramer, omtcyfz, cfe-commits

Differential Revision: https://reviews.llvm.org/D24243

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: