aboutsummaryrefslogtreecommitdiff
path: root/tools/libclang/IndexBody.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-09-10 22:58:04 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-09-10 22:58:04 +0000
commit3bed3d196dbb5ad2ea7442da4b6c2fbf6bb5fcc6 (patch)
tree5c363089c186d5caac88a271f9d3af229b574817 /tools/libclang/IndexBody.cpp
parent57330eed3fbe530cb05996e4a346cc5fc217c0d9 (diff)
[libclang] Do index 'extern' declarations inside functions.
rdar://12257073 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163563 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/IndexBody.cpp')
-rw-r--r--tools/libclang/IndexBody.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/libclang/IndexBody.cpp b/tools/libclang/IndexBody.cpp
index acf8838940..3614206dee 100644
--- a/tools/libclang/IndexBody.cpp
+++ b/tools/libclang/IndexBody.cpp
@@ -130,8 +130,20 @@ public:
}
bool VisitDeclStmt(DeclStmt *S) {
- if (IndexCtx.shouldIndexFunctionLocalSymbols())
+ if (IndexCtx.shouldIndexFunctionLocalSymbols()) {
IndexCtx.indexDeclGroupRef(S->getDeclGroup());
+ return true;
+ }
+
+ DeclGroupRef DG = S->getDeclGroup();
+ for (DeclGroupRef::iterator I = DG.begin(), E = DG.end(); I != E; ++I) {
+ const Decl *D = *I;
+ if (!D)
+ continue;
+ if (!IndexCtx.isFunctionLocalDecl(D))
+ IndexCtx.indexTopLevelDecl(D);
+ }
+
return true;
}