aboutsummaryrefslogtreecommitdiff
path: root/tools/libclang/IndexingContext.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-12-07 20:44:19 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-12-07 20:44:19 +0000
commitb1febb646bf7a2f319ad894c9833968c52d21711 (patch)
tree7277ce2d6f037ba6288c750318dfb4a8e33ae7c9 /tools/libclang/IndexingContext.cpp
parentb526a871af40b84d9878eded54a181bf4003b376 (diff)
[libclang] Indexing API: provide both the semantic and the lexical container.
They are generally the same except in C++ cases like out-of-line member functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146069 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/IndexingContext.cpp')
-rw-r--r--tools/libclang/IndexingContext.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/libclang/IndexingContext.cpp b/tools/libclang/IndexingContext.cpp
index 0ec8619bed..657aed8f6a 100644
--- a/tools/libclang/IndexingContext.cpp
+++ b/tools/libclang/IndexingContext.cpp
@@ -239,8 +239,10 @@ bool IndexingContext::handleDecl(const NamedDecl *D,
DInfo.attributes = AttrList.getAttrs();
DInfo.numAttributes = AttrList.getNumAttrs();
- getContainerInfo(D->getDeclContext(), DInfo.Container);
- DInfo.container = &DInfo.Container;
+ getContainerInfo(D->getDeclContext(), DInfo.SemanticContainer);
+ getContainerInfo(D->getLexicalDeclContext(), DInfo.LexicalContainer);
+ DInfo.semanticContainer = &DInfo.SemanticContainer;
+ DInfo.lexicalContainer = &DInfo.LexicalContainer;
if (DInfo.isContainer) {
getContainerInfo(getEntityContainer(D), DInfo.DeclAsContainer);
DInfo.declAsContainer = &DInfo.DeclAsContainer;
@@ -506,12 +508,12 @@ bool IndexingContext::handleReference(const NamedDecl *D, SourceLocation Loc,
ContainerInfo Container;
getContainerInfo(DC, Container);
- CXIdxEntityRefInfo Info = { Cursor,
+ CXIdxEntityRefInfo Info = { Kind,
+ Cursor,
getIndexLoc(Loc),
&RefEntity,
Parent ? &ParentEntity : 0,
- &Container,
- Kind };
+ &Container };
CB.indexEntityReference(ClientData, &Info);
return true;
}