[clang-rename] Fix handling of unchanged files
authorAlexander Shaposhnikov <shal1t712@gmail.com>
Sat, 17 Sep 2016 17:08:47 +0000 (17:08 +0000)
committerAlexander Shaposhnikov <shal1t712@gmail.com>
Sat, 17 Sep 2016 17:08:47 +0000 (17:08 +0000)
commite4920c6fb9f04f74a8365eed6c50fd21a57b1564
tree74c855460d095d51bd9406663d0dcd95a6eda6d9
parentda5df7c99ed402cb8a9ae3c54abbbe72eeafdc6a
[clang-rename] Fix handling of unchanged files

Fix the output of clang-rename for the files without modifications.
Update the code in clang-reorder-fields/tool/ClangReorderFields.cpp
to avoid inconsistency.

Example:
a.h:
struct A {};
a.cpp:
#include "a.h"
int main() { return 0; }

Before the changes the output looks like this:
clang-rename -qualified-name=A -new-name=B a.cpp
<<<<<INVALID SOURCE LOCATION>>>>>

Test plan: make -j8 check-clang-tools

Differential revision: https://reviews.llvm.org/D24634

llvm-svn: 281826
clang-tools-extra/clang-rename/tool/ClangRename.cpp
clang-tools-extra/clang-reorder-fields/tool/ClangReorderFields.cpp
clang-tools-extra/test/clang-rename/IncludeHeaderWithSymbol.cpp [new file with mode: 0644]
clang-tools-extra/test/clang-rename/Inputs/HeaderWithSymbol.h [new file with mode: 0644]