summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2013-11-12 22:16:08 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2013-11-12 22:16:08 +0000
commitf6785e3117c0ce447e4d70065e069a9dc031f14c (patch)
tree6c2e81fa2886507f8cdb887616f6600eaf146703 /tools
parent610616c279681aa195cdf63b6472bc811e7d75a0 (diff)
downloadclang-f6785e3117c0ce447e4d70065e069a9dc031f14c.tar.gz
clang-f6785e3117c0ce447e4d70065e069a9dc031f14c.tar.bz2
clang-f6785e3117c0ce447e4d70065e069a9dc031f14c.tar.xz
Documentation parsing: add support for \throws \throw \exception commands
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194521 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/libclang/CXComment.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/libclang/CXComment.cpp b/tools/libclang/CXComment.cpp
index 46588568dc..1df6e240d9 100644
--- a/tools/libclang/CXComment.cpp
+++ b/tools/libclang/CXComment.cpp
@@ -25,6 +25,7 @@
#include "clang/Lex/Lexer.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
+#include "llvm/ADT/TinyPtrVector.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <climits>
@@ -424,6 +425,7 @@ struct FullCommentParts {
SmallVector<const BlockCommandComment *, 4> Returns;
SmallVector<const ParamCommandComment *, 8> Params;
SmallVector<const TParamCommandComment *, 4> TParams;
+ llvm::TinyPtrVector<const BlockCommandComment *> Exceptions;
SmallVector<const BlockContentComment *, 8> MiscBlocks;
};
@@ -465,6 +467,10 @@ FullCommentParts::FullCommentParts(const FullComment *C,
Returns.push_back(BCC);
break;
}
+ if (Info->IsThrowsCommand) {
+ Exceptions.push_back(BCC);
+ break;
+ }
MiscBlocks.push_back(BCC);
break;
}
@@ -1322,6 +1328,13 @@ void CommentASTToXMLConverter::visitFullComment(const FullComment *C) {
Result << "</Parameters>";
}
+ if (Parts.Exceptions.size() != 0) {
+ Result << "<Exceptions>";
+ for (unsigned i = 0, e = Parts.Exceptions.size(); i != e; ++i)
+ visit(Parts.Exceptions[i]);
+ Result << "</Exceptions>";
+ }
+
if (Parts.Returns.size() != 0) {
Result << "<ResultDiscussion>";
for (unsigned i = 0, e = Parts.Returns.size(); i != e; ++i)