summaryrefslogtreecommitdiffstats
path: root/tools/libclang/IndexDecl.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-08-15 20:02:54 +0000
committerdim <dim@FreeBSD.org>2012-08-15 20:02:54 +0000
commit554bcb69c2d785a011a30e7db87a36a87fe7db10 (patch)
tree9abb1a658a297776086f4e0dfa6ca533de02104e /tools/libclang/IndexDecl.cpp
parentbb67ca86b31f67faee50bd10c3b036d65751745a (diff)
downloadFreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.zip
FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.tar.gz
Vendor import of clang trunk r161861:
http://llvm.org/svn/llvm-project/cfe/trunk@161861
Diffstat (limited to 'tools/libclang/IndexDecl.cpp')
-rw-r--r--tools/libclang/IndexDecl.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/libclang/IndexDecl.cpp b/tools/libclang/IndexDecl.cpp
index c257c34..7560398 100644
--- a/tools/libclang/IndexDecl.cpp
+++ b/tools/libclang/IndexDecl.cpp
@@ -154,7 +154,20 @@ public:
IndexCtx.handleObjCImplementation(D);
IndexCtx.indexTUDeclsInObjCContainer();
- IndexCtx.indexDeclContext(D);
+
+ // Index the ivars first to make sure the synthesized ivars are indexed
+ // before indexing the methods that can reference them.
+ for (ObjCImplementationDecl::ivar_iterator
+ IvarI = D->ivar_begin(),
+ IvarE = D->ivar_end(); IvarI != IvarE; ++IvarI) {
+ IndexCtx.indexDecl(*IvarI);
+ }
+ for (DeclContext::decl_iterator
+ I = D->decls_begin(), E = D->decls_end(); I != E; ++I) {
+ if (!isa<ObjCIvarDecl>(*I))
+ IndexCtx.indexDecl(*I);
+ }
+
return true;
}
OpenPOWER on IntegriCloud