Commit Graph

59 Commits

Author SHA1 Message Date
Renato Golin 0dccd1a0fd Revert "[clang-move] Support moving multiple classes in one run."
This reverts commit r283526 et al as it keeps randomly breaking bots, even after
the commit has gone, on other people's commit ranges.

Revert "[clang-move] Simplify lint tests" (r283545).
Revert "Fix buildbot error." (r283534).
Revert "Revert "fix buildbot error" since it is not right fix." (r283538).

llvm-svn: 283553
2016-10-07 13:58:10 +00:00
Haojian Wu a709e384ce [clang-move] Support moving multiple classes in one run.
Reviewers: ioeric

Subscribers: cfe-commits

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

llvm-svn: 283526
2016-10-07 08:29:20 +00:00
Haojian Wu 9abbeaad55 [clang-move] Move comments which are associated with the moved class.
Reviewers: ioeric

Subscribers: cfe-commits

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

llvm-svn: 283425
2016-10-06 08:59:24 +00:00
Haojian Wu 253d596d4a [clang-move] Cleanup around replacements.
Summary:
cleanup the remaining empty namespace after moving out the
class defintitions.

Reviewers: ioeric

Subscribers: cfe-commits

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

llvm-svn: 283424
2016-10-06 08:29:32 +00:00
Haojian Wu c6f125e9a5 Fix windows builtbot error.
llvm-svn: 283205
2016-10-04 09:49:20 +00:00
Haojian Wu d2a6d7b203 [clang-move] Make it support both relative and absolute file path arguments.
Reviewers: ioeric

Subscribers: beanz, mgorny, cfe-commits

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

llvm-svn: 283202
2016-10-04 09:05:31 +00:00
Haojian Wu ef247cb2c9 [clang-move] Use isStaticStorageClass matcher.
llvm-svn: 282477
2016-09-27 08:01:04 +00:00
Haojian Wu daf4cb8b6a [clang-move] The new.cc file should include new_header.h instead of old_header.h
Summary:
Previously, all #includes (includeing old_header.h) in old.cc will be copied to new.cc,
however, the new.cc should include new_header.h instead of the old_header.h

Before applying the patch, the new.cc looks like:

```
#include "old_header.h"
...
```

The new.cc looks like with this patch:

```
#include "new_header"
...
```

Reviewers: ioeric

Subscribers: cfe-commits

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

llvm-svn: 282247
2016-09-23 13:28:38 +00:00
Haojian Wu 357ef99917 [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

llvm-svn: 282070
2016-09-21 13:18:19 +00:00