summaryrefslogtreecommitdiffstats
path: root/tools/libclang/CXComment.h
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-12-02 13:20:44 +0000
committerdim <dim@FreeBSD.org>2012-12-02 13:20:44 +0000
commit056abd2059c65a3e908193aeae16fad98017437c (patch)
tree2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /tools/libclang/CXComment.h
parentcc73504950eb7b5dff2dded9bedd67bc36d64641 (diff)
downloadFreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.zip
FreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.tar.gz
Vendor import of clang release_32 branch r168974 (effectively, 3.2 RC2):
http://llvm.org/svn/llvm-project/cfe/branches/release_32@168974
Diffstat (limited to 'tools/libclang/CXComment.h')
-rw-r--r--tools/libclang/CXComment.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/tools/libclang/CXComment.h b/tools/libclang/CXComment.h
index 753877e..5134317 100644
--- a/tools/libclang/CXComment.h
+++ b/tools/libclang/CXComment.h
@@ -15,20 +15,29 @@
#define LLVM_CLANG_CXCOMMENT_H
#include "clang-c/Index.h"
+#include "CXTranslationUnit.h"
#include "clang/AST/Comment.h"
+#include "clang/AST/ASTContext.h"
+#include "clang/Frontend/ASTUnit.h"
namespace clang {
+namespace comments {
+ class CommandTraits;
+}
+
namespace cxcomment {
-inline CXComment createCXComment(const comments::Comment *C) {
+inline CXComment createCXComment(const comments::Comment *C,
+ CXTranslationUnit TU) {
CXComment Result;
- Result.Data = C;
+ Result.ASTNode = C;
+ Result.TranslationUnit = TU;
return Result;
}
inline const comments::Comment *getASTNode(CXComment CXC) {
- return static_cast<const comments::Comment *>(CXC.Data);
+ return static_cast<const comments::Comment *>(CXC.ASTNode);
}
template<typename T>
@@ -40,6 +49,14 @@ inline const T *getASTNodeAs(CXComment CXC) {
return dyn_cast<T>(C);
}
+inline ASTContext &getASTContext(CXComment CXC) {
+ return static_cast<ASTUnit *>(CXC.TranslationUnit->TUData)->getASTContext();
+}
+
+inline comments::CommandTraits &getCommandTraits(CXComment CXC) {
+ return getASTContext(CXC).getCommentCommandTraits();
+}
+
} // end namespace cxcomment
} // end namespace clang
OpenPOWER on IntegriCloud