projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
da16507
)
Don't touch unchanged file for in-place edit.
author
Daniel Jasper
<djasper@google.com>
Wed, 30 Jan 2013 09:52:38 +0000
(09:52 +0000)
committer
Daniel Jasper
<djasper@google.com>
Wed, 30 Jan 2013 09:52:38 +0000
(09:52 +0000)
This fixes llvm.org/PR15087.
llvm-svn: 173919
clang-tools-extra/clang-format/ClangFormat.cpp
patch
|
blob
|
history
diff --git
a/clang-tools-extra/clang-format/ClangFormat.cpp
b/clang-tools-extra/clang-format/ClangFormat.cpp
index
23043a3
..
da032d5
100644
(file)
--- a/
clang-tools-extra/clang-format/ClangFormat.cpp
+++ b/
clang-tools-extra/clang-format/ClangFormat.cpp
@@
-97,6
+97,9
@@
static void format() {
Rewriter Rewrite(Sources, LangOptions());
tooling::applyAllReplacements(Replaces, Rewrite);
if (Inplace) {
+ if (Replaces.size() == 0)
+ return; // Nothing changed, don't touch the file.
+
std::string ErrorInfo;
llvm::raw_fd_ostream FileStream(FileName.c_str(), ErrorInfo,
llvm::raw_fd_ostream::F_Binary);