Comment XML: use xml:space="preserve" in Verbatim tags, so that XML tidy does
not compress spaces in verbatim content.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161531 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/CXComment.cpp b/tools/libclang/CXComment.cpp
index 4e7bf76..4606fdc 100644
--- a/tools/libclang/CXComment.cpp
+++ b/tools/libclang/CXComment.cpp
@@ -982,8 +982,8 @@
return;
Result << llvm::StringSwitch<const char *>(C->getCommandName())
- .Case("code", "<Verbatim kind=\"code\">")
- .Default("<Verbatim kind=\"verbatim\">");
+ .Case("code", "<Verbatim xml:space=\"preserve\" kind=\"code\">")
+ .Default("<Verbatim xml:space=\"preserve\" kind=\"verbatim\">");
for (unsigned i = 0; i != NumLines; ++i) {
appendToResultWithXMLEscaping(C->getText(i));
if (i + 1 != NumLines)
@@ -999,7 +999,7 @@
void CommentASTToXMLConverter::visitVerbatimLineComment(
const VerbatimLineComment *C) {
- Result << "<Verbatim kind=\"verbatim\">";
+ Result << "<Verbatim xml:space=\"preserve\" kind=\"verbatim\">";
appendToResultWithXMLEscaping(C->getText());
Result << "</Verbatim>";
}