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:
20e0af6
)
clang-format: Don't allow -i when reading from stdin.
author
Daniel Jasper
<djasper@google.com>
Wed, 6 May 2015 11:56:54 +0000
(11:56 +0000)
committer
Daniel Jasper
<djasper@google.com>
Wed, 6 May 2015 11:56:54 +0000
(11:56 +0000)
llvm-svn: 236592
clang/tools/clang-format/ClangFormat.cpp
patch
|
blob
|
history
diff --git
a/clang/tools/clang-format/ClangFormat.cpp
b/clang/tools/clang-format/ClangFormat.cpp
index
f611f70
..
fe7d678
100644
(file)
--- a/
clang/tools/clang-format/ClangFormat.cpp
+++ b/
clang/tools/clang-format/ClangFormat.cpp
@@
-247,7
+247,9
@@
static bool format(StringRef FileName) {
Rewriter Rewrite(Sources, LangOptions());
tooling::applyAllReplacements(Replaces, Rewrite);
if (Inplace) {
- if (Rewrite.overwriteChangedFiles())
+ if (FileName == "-")
+ llvm::errs() << "error: cannot use -i when reading from stdin.\n";
+ else if (Rewrite.overwriteChangedFiles())
return true;
} else {
if (Cursor.getNumOccurrences() != 0)