aboutsummaryrefslogtreecommitdiff
path: root/clang/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
commitd9febeb884dccaf0714ebd04694cb618cacfcd78 (patch)
treed0875c87ede2a31a48d958308f0526741d7dcd05 /clang/tools
parent129d313c8d133218f142e77ce89dd5e19e5feb75 (diff)
downloadllvm-d9febeb884dccaf0714ebd04694cb618cacfcd78.zip
llvm-d9febeb884dccaf0714ebd04694cb618cacfcd78.tar.gz
llvm-d9febeb884dccaf0714ebd04694cb618cacfcd78.tar.bz2
Documentation parsing: add support for \throws \throw \exception commands
llvm-svn: 194521
Diffstat (limited to 'clang/tools')
-rw-r--r--clang/tools/libclang/CXComment.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/tools/libclang/CXComment.cpp b/clang/tools/libclang/CXComment.cpp
index 4658856..1df6e24 100644
--- a/clang/tools/libclang/CXComment.cpp
+++ b/clang/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)