aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-05-07 01:04:29 +0000
committerTed Kremenek <kremenek@apple.com>2010-05-07 01:04:29 +0000
commita0536d8dd900bb48ea886bd68d777b03b061c068 (patch)
tree3696840212b3133a35916540c8acc47171721a20
parentd5d90fedcc07222acde24dce357266161836b302 (diff)
Add CXCursor support for LinkageSpecDecl (e.g., 'extern "C"').
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103224 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang-c/Index.h4
-rw-r--r--tools/libclang/CIndex.cpp7
2 files changed, 10 insertions, 1 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h
index 8e6542e40c..e1826df76f 100644
--- a/include/clang-c/Index.h
+++ b/include/clang-c/Index.h
@@ -704,8 +704,10 @@ enum CXCursorKind {
CXCursor_CXXMethod = 21,
/** \brief A C++ namespace. */
CXCursor_Namespace = 22,
+ /** \brief A linkage specification, e.g. 'extern "C"'. */
+ CXCursor_LinkageSpec = 23,
- CXCursor_LastDecl = CXCursor_Namespace,
+ CXCursor_LastDecl = CXCursor_LinkageSpec,
/* References */
CXCursor_FirstRef = 40, /* Decl references */
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index f221d16af2..3d55a10aaf 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -285,6 +285,7 @@ public:
// FIXME: ObjCCompatibleAliasDecl requires aliased-class locations.
bool VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *D);
bool VisitObjCClassDecl(ObjCClassDecl *D);
+ bool VisitLinkageSpecDecl(LinkageSpecDecl *D);
bool VisitNamespaceDecl(NamespaceDecl *D);
// Type visitors
@@ -727,6 +728,10 @@ bool CursorVisitor::VisitNamespaceDecl(NamespaceDecl *D) {
return VisitDeclContext(D);
}
+bool CursorVisitor::VisitLinkageSpecDecl(LinkageSpecDecl *D) {
+ return VisitDeclContext(D);
+}
+
bool CursorVisitor::VisitBuiltinTypeLoc(BuiltinTypeLoc TL) {
ASTContext &Context = TU->getASTContext();
@@ -1645,6 +1650,8 @@ CXString clang_getCursorKindSpelling(enum CXCursorKind Kind) {
return createCXString("macro instantiation");
case CXCursor_Namespace:
return createCXString("Namespace");
+ case CXCursor_LinkageSpec:
+ return createCXString("LinkageSpec");
}
llvm_unreachable("Unhandled CXCursorKind");