[clang-move] Make the output code look more pretty.
authorHaojian Wu <hokein@google.com>
Tue, 15 Nov 2016 09:06:59 +0000 (09:06 +0000)
committerHaojian Wu <hokein@google.com>
Tue, 15 Nov 2016 09:06:59 +0000 (09:06 +0000)
commit53315a7b98dd97f9ead880ecf84906b01e8958d2
treec35130e07437b56940f1245a7a684d816a9bdc51
parent8741656efdd0b4f5a4dd6d2f6b7ad8d6e4f09725
[clang-move] Make the output code look more pretty.

Summary:
Add decent blank lines between declarations:
* Add extra blank line after #define or #includes.
* Add extra blank line between declarations.
* Add extra blank line in front of #endif.

Previously, the new generated code is quite tight:

```
#ifndef FOO_H
#define FOO_H
namespace a {
class A { public: int f(); };
int A::f() { return 0; }
} // namespace a
#endif // FOO_H
```

After this patch, the code looks like:

```
#ifndef FOO_H
#define FOO_H

namespace a {
class A { public: int f(); };

int A::f() { return 0; }
} // namespace a

#endif // FOO_H
```

Reviewers: ioeric

Subscribers: cfe-commits

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

llvm-svn: 286943
clang-tools-extra/clang-move/ClangMove.cpp
clang-tools-extra/unittests/clang-move/ClangMoveTests.cpp