summaryrefslogtreecommitdiffstats
path: root/clang/tools/clang-format/ClangFormat.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-05-21 14:21:46 +0000
committerDaniel Jasper <djasper@google.com>2013-05-21 14:21:46 +0000
commita8048b8216cd517f92ae36bd634299ac21bafe75 (patch)
tree5e81e3fe4c567c8b2b743f01b80e379c628c7f3a /clang/tools/clang-format/ClangFormat.cpp
parentc5211291f1abbc792fcbddf49c28b969d857bbc9 (diff)
downloadbcm5719-llvm-a8048b8216cd517f92ae36bd634299ac21bafe75.tar.gz
bcm5719-llvm-a8048b8216cd517f92ae36bd634299ac21bafe75.zip
Fix behavior of clang-format's -cursor flag.
llvm-svn: 182386
Diffstat (limited to 'clang/tools/clang-format/ClangFormat.cpp')
-rw-r--r--clang/tools/clang-format/ClangFormat.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/tools/clang-format/ClangFormat.cpp b/clang/tools/clang-format/ClangFormat.cpp
index 340ef5587ff..764200308d0 100644
--- a/clang/tools/clang-format/ClangFormat.cpp
+++ b/clang/tools/clang-format/ClangFormat.cpp
@@ -226,7 +226,7 @@ static bool format(std::string FileName) {
Rewrite.getEditBuffer(ID).write(FileStream);
FileStream.flush();
} else {
- if (Cursor != 0)
+ if (Cursor.getNumOccurrences() != 0)
outs() << "{ \"Cursor\": " << tooling::shiftedCodePosition(
Replaces, Cursor) << " }\n";
Rewrite.getEditBuffer(ID).write(outs());
OpenPOWER on IntegriCloud