[libclang] Index C++ namespaces.

llvm-svn: 146019
This commit is contained in:
Argyrios Kyrtzidis 2011-12-07 05:52:06 +00:00
parent 2f0400b780
commit 2b0b43cf56
3 changed files with 15 additions and 0 deletions

View File

@ -189,6 +189,12 @@ public:
return true;
}
bool VisitNamespaceDecl(NamespaceDecl *D) {
IndexCtx.handleNamespace(D);
IndexCtx.indexDeclContext(D);
return true;
}
bool VisitClassTemplateDecl(ClassTemplateDecl *D) {
IndexCtx.handleClassTemplate(D);
if (D->isThisDeclarationADefinition())

View File

@ -401,6 +401,13 @@ bool IndexingContext::handleObjCProperty(const ObjCPropertyDecl *D) {
return handleDecl(D, D->getLocation(), getCursor(D), DInfo);
}
bool IndexingContext::handleNamespace(const NamespaceDecl *D) {
DeclInfo DInfo(/*isRedeclaration=*/!D->isOriginalNamespace(),
/*isDefinition=*/true,
/*isContainer=*/true);
return handleDecl(D, D->getLocation(), getCursor(D), DInfo);
}
bool IndexingContext::handleClassTemplate(const ClassTemplateDecl *D) {
return handleCXXRecordDecl(D->getTemplatedDecl(), D);
}

View File

@ -370,6 +370,8 @@ public:
bool handleObjCProperty(const ObjCPropertyDecl *D);
bool handleNamespace(const NamespaceDecl *D);
bool handleClassTemplate(const ClassTemplateDecl *D);
bool handleFunctionTemplate(const FunctionTemplateDecl *D);
bool handleTypeAliasTemplate(const TypeAliasTemplateDecl *D);