summaryrefslogtreecommitdiffstats
path: root/lib/Format/BreakableToken.cpp
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
commit422116da285cd4ffe35ffffc5e8fee25ace24f14 (patch)
tree1793312b882f354f285877be93dd2eee5bdd3833 /lib/Format/BreakableToken.cpp
parentb38543d2c36e7e905dbdb3ec3ace2167421b562d (diff)
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303330 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/BreakableToken.cpp')
-rw-r--r--lib/Format/BreakableToken.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Format/BreakableToken.cpp b/lib/Format/BreakableToken.cpp
index c97486e4e4..f70597cdba 100644
--- a/lib/Format/BreakableToken.cpp
+++ b/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;