summaryrefslogtreecommitdiffstats
path: root/clang/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
commit663c8ecda1323657d2f4fa2de6c6f7378b3eae87 (patch)
treeff067de2211603a63336e039205b42d7fcbbe825 /clang/tools/libclang/IndexingContext.cpp
parentb3c16bad2096aca843807b35012ac82c405c907c (diff)
downloadbcm5719-llvm-663c8ecda1323657d2f4fa2de6c6f7378b3eae87.tar.gz
bcm5719-llvm-663c8ecda1323657d2f4fa2de6c6f7378b3eae87.zip
[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. llvm-svn: 146069
Diffstat (limited to 'clang/tools/libclang/IndexingContext.cpp')
-rw-r--r--clang/tools/libclang/IndexingContext.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/tools/libclang/IndexingContext.cpp b/clang/tools/libclang/IndexingContext.cpp
index 0ec8619bed2..657aed8f6a9 100644
--- a/clang/tools/libclang/IndexingContext.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud