summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2015-01-09 10:03:47 +0000
committerManuel Klimek <klimek@google.com>2015-01-09 10:03:47 +0000
commit949ff4d9f2eac092bce2e0d73f1262f829ae4d78 (patch)
treed595a6642093a9145ae6b7ee00ad6fb95693387a /clang
parentaabcb80096e4e3dcbbb36a2c913d17ac3f7fcddc (diff)
downloadbcm5719-llvm-949ff4d9f2eac092bce2e0d73f1262f829ae4d78.tar.gz
bcm5719-llvm-949ff4d9f2eac092bce2e0d73f1262f829ae4d78.zip
Add the shifted cursor position to XML output, so it can be used by editor integrations.
llvm-svn: 225516
Diffstat (limited to 'clang')
-rw-r--r--clang/tools/clang-format/ClangFormat.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/tools/clang-format/ClangFormat.cpp b/clang/tools/clang-format/ClangFormat.cpp
index cacc51fd977..d44d407aa86 100644
--- a/clang/tools/clang-format/ClangFormat.cpp
+++ b/clang/tools/clang-format/ClangFormat.cpp
@@ -229,6 +229,10 @@ static bool format(StringRef FileName) {
if (OutputXML) {
llvm::outs()
<< "<?xml version='1.0'?>\n<replacements xml:space='preserve'>\n";
+ if (Cursor.getNumOccurrences() != 0)
+ llvm::outs() << "<cursor>"
+ << tooling::shiftedCodePosition(Replaces, Cursor)
+ << "</cursor>\n";
for (tooling::Replacements::const_iterator I = Replaces.begin(),
E = Replaces.end();
I != E; ++I) {
OpenPOWER on IntegriCloud