aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2012-07-17 18:35:14 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2012-07-17 18:35:14 +0000
commit659a7124c7069b3e01dd171f7290562f58f9e97a (patch)
tree7d322a0e9174c4d3437f38bd217774c94e606d62
parent379b28183a7dcb715c3f3eb2da4b0157d6d8ffbe (diff)
CommentBriefParser: make \short should equivalent to \brief, per Doxygen manual.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160383 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AST/CommentBriefParser.cpp3
-rw-r--r--test/Index/annotate-comments.cpp17
2 files changed, 16 insertions, 4 deletions
diff --git a/lib/AST/CommentBriefParser.cpp b/lib/AST/CommentBriefParser.cpp
index bc9244a693..687ece2194 100644
--- a/lib/AST/CommentBriefParser.cpp
+++ b/lib/AST/CommentBriefParser.cpp
@@ -43,6 +43,7 @@ void cleanupBrief(std::string &S) {
bool isBlockCommand(StringRef Name) {
return llvm::StringSwitch<bool>(Name)
.Case("brief", true)
+ .Case("short", true)
.Case("result", true)
.Case("return", true)
.Case("returns", true)
@@ -71,7 +72,7 @@ std::string BriefParser::Parse() {
if (Tok.is(tok::command)) {
StringRef Name = Tok.getCommandName();
- if (Name == "brief") {
+ if (Name == "brief" || Name == "short") {
Paragraph.clear();
InBrief = true;
ConsumeToken();
diff --git a/test/Index/annotate-comments.cpp b/test/Index/annotate-comments.cpp
index 18dab24618..406e743f87 100644
--- a/test/Index/annotate-comments.cpp
+++ b/test/Index/annotate-comments.cpp
@@ -194,14 +194,24 @@ void isdoxy44(void);
/// Ggg. IS_DOXYGEN_END
void isdoxy45(void);
+/// IS_DOXYGEN_START Aaa bbb
+/// ccc.
+///
+/// \short
+/// Ddd eee.
+/// Fff.
+///
+/// Ggg. IS_DOXYGEN_END
+void isdoxy46(void);
+
/// IS_DOXYGEN_NOT_ATTACHED
#define FOO
-void notdoxy46(void);
+void notdoxy47(void);
/// IS_DOXYGEN_START Aaa bbb
/// \param ccc
/// \returns ddd IS_DOXYGEN_END
-void isdoxy47(int);
+void isdoxy48(int);
#endif
@@ -267,5 +277,6 @@ void isdoxy47(int);
// CHECK: annotate-comments.cpp:185:6: FunctionDecl=isdoxy44:{{.*}} BriefComment=[IS_DOXYGEN_START Aaa bbb ccc.]
// CHECK: annotate-comments.cpp:195:6: FunctionDecl=isdoxy45:{{.*}} BriefComment=[Ddd eee. Fff.]
-// CHECK: annotate-comments.cpp:204:6: FunctionDecl=isdoxy47:{{.*}} BriefComment=[IS_DOXYGEN_START Aaa bbb]
+// CHECK: annotate-comments.cpp:205:6: FunctionDecl=isdoxy46:{{.*}} BriefComment=[Ddd eee. Fff.]
+// CHECK: annotate-comments.cpp:214:6: FunctionDecl=isdoxy48:{{.*}} BriefComment=[IS_DOXYGEN_START Aaa bbb]