summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorKrasimir Georgiev <krasimir@google.com>2017-05-18 07:36:21 +0000
committerKrasimir Georgiev <krasimir@google.com>2017-05-18 07:36:21 +0000
commitba6b315ea92fec6bdf5092511c23f6681805cfd0 (patch)
treeeb18121afccbab65664b0db2644999a98d737953 /clang/lib/Format
parent00211c3faa581179fe5c5c90818db92a262c62f2 (diff)
downloadbcm5719-llvm-ba6b315ea92fec6bdf5092511c23f6681805cfd0.tar.gz
bcm5719-llvm-ba6b315ea92fec6bdf5092511c23f6681805cfd0.zip
clang-format: fix prefix for doxygen comments after member
Summary: Doxygen supports putting documentation blocks after member, by adding an additional < marker in the comment block. This patch makes sure this marker is used in lines which are introduced by breaking the comment. int foo; ///< Some very long comment. becomes: int foo; ///< Some very long ///< comment. Contributed by @Typz! Reviewers: krasimir Reviewed By: krasimir Subscribers: djasper, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D33282 llvm-svn: 303330
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/BreakableToken.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Format/BreakableToken.cpp b/clang/lib/Format/BreakableToken.cpp
index c97486e4e4a..f70597cdba8 100644
--- a/clang/lib/Format/BreakableToken.cpp
+++ b/clang/lib/Format/BreakableToken.cpp
@@ -41,7 +41,8 @@ static bool IsBlank(char C) {
}
static StringRef getLineCommentIndentPrefix(StringRef Comment) {
- static const char *const KnownPrefixes[] = {"///", "//", "//!"};
+ static const char *const KnownPrefixes[] = {
+ "///<", "//!<", "///", "//", "//!"};
StringRef LongestPrefix;
for (StringRef KnownPrefix : KnownPrefixes) {
if (Comment.startswith(KnownPrefix)) {
@@ -692,6 +693,10 @@ BreakableLineCommentSection::BreakableLineCommentSection(
Prefix[i] = "/// ";
else if (Prefix[i] == "//!")
Prefix[i] = "//! ";
+ else if (Prefix[i] == "///<")
+ Prefix[i] = "///< ";
+ else if (Prefix[i] == "//!<")
+ Prefix[i] = "//!< ";
}
Tokens[i] = LineTok;
OpenPOWER on IntegriCloud