diff options
Diffstat (limited to 'tools/libclang/IndexDecl.cpp')
-rw-r--r-- | tools/libclang/IndexDecl.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tools/libclang/IndexDecl.cpp b/tools/libclang/IndexDecl.cpp index 58f449d3cc..67f6703e75 100644 --- a/tools/libclang/IndexDecl.cpp +++ b/tools/libclang/IndexDecl.cpp @@ -172,17 +172,19 @@ void IndexingContext::indexDeclContext(const DeclContext *DC) { } } -void IndexingContext::indexDeclGroupRef(DeclGroupRef DG) { - for (DeclGroupRef::iterator I = DG.begin(), E = DG.end(); I != E; ++I) { - Decl *D = *I; - if (isNotFromSourceFile(D->getLocation())) - return; +void IndexingContext::indexTopLevelDecl(Decl *D) { + if (isNotFromSourceFile(D->getLocation())) + return; - if (isa<ObjCMethodDecl>(D)) - continue; // Wait for the objc container. + if (isa<ObjCMethodDecl>(D)) + return; // Wait for the objc container. - indexDecl(D); - } + indexDecl(D); +} + +void IndexingContext::indexDeclGroupRef(DeclGroupRef DG) { + for (DeclGroupRef::iterator I = DG.begin(), E = DG.end(); I != E; ++I) + indexTopLevelDecl(*I); } void IndexingContext::indexTUDeclsInObjCContainer() { |