Add CXCursor support for LinkageSpecDecl (e.g., 'extern "C"').

llvm-svn: 103224
This commit is contained in:
Ted Kremenek 2010-05-07 01:04:29 +00:00
parent fca5afb421
commit b80cba5d7d
2 changed files with 10 additions and 1 deletions

View File

@ -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 */

View File

@ -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");