[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
diff --git a/tools/libclang/IndexingContext.cpp b/tools/libclang/IndexingContext.cpp
index 0ec8619..657aed8 100644
--- a/tools/libclang/IndexingContext.cpp
+++ b/tools/libclang/IndexingContext.cpp
@@ -239,8 +239,10 @@
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 @@
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;
}