summaryrefslogtreecommitdiffstats
path: root/clang/lib/Index/CommentToXML.cpp
diff options
context:
space:
mode:
authorKrasimir Georgiev <krasimir@google.com>2017-03-01 15:35:39 +0000
committerKrasimir Georgiev <krasimir@google.com>2017-03-01 15:35:39 +0000
commit32eaa864e382b688a9407836f19a094ab4ee39d1 (patch)
tree90a3224212c3d6f36919ece1a2ee08a29c927d61 /clang/lib/Index/CommentToXML.cpp
parent9c52309b372137479b872b88daff5ffd135f4bf7 (diff)
downloadbcm5719-llvm-32eaa864e382b688a9407836f19a094ab4ee39d1.tar.gz
bcm5719-llvm-32eaa864e382b688a9407836f19a094ab4ee39d1.zip
[clang-format] Add a new flag FixNamespaceComments to FormatStyle
Summary: This patch enables namespace end comments under a new flag FixNamespaceComments, which is enabled for the LLVM and Google styles. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D30405 llvm-svn: 296632
Diffstat (limited to 'clang/lib/Index/CommentToXML.cpp')
-rw-r--r--clang/lib/Index/CommentToXML.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Index/CommentToXML.cpp b/clang/lib/Index/CommentToXML.cpp
index ee066cc6d98..08acc96c4ef 100644
--- a/clang/lib/Index/CommentToXML.cpp
+++ b/clang/lib/Index/CommentToXML.cpp
@@ -593,9 +593,11 @@ void CommentASTToXMLConverter::formatTextOfDeclaration(
unsigned Length = Declaration.size();
bool IncompleteFormat = false;
+ format::FormatStyle Style = format::getLLVMStyle();
+ Style.FixNamespaceComments = false;
tooling::Replacements Replaces =
- reformat(format::getLLVMStyle(), StringDecl,
- tooling::Range(Offset, Length), "xmldecl.xd", &IncompleteFormat);
+ reformat(Style, StringDecl, tooling::Range(Offset, Length), "xmldecl.xd",
+ &IncompleteFormat);
auto FormattedStringDecl = applyAllReplacements(StringDecl, Replaces);
if (static_cast<bool>(FormattedStringDecl)) {
Declaration = *FormattedStringDecl;
OpenPOWER on IntegriCloud