diff options
-rw-r--r-- | tools/libclang/IndexingContext.cpp | 22 | ||||
-rw-r--r-- | tools/libclang/IndexingContext.h | 6 |
2 files changed, 0 insertions, 28 deletions
diff --git a/tools/libclang/IndexingContext.cpp b/tools/libclang/IndexingContext.cpp index 657aed8f6a..0b18167e80 100644 --- a/tools/libclang/IndexingContext.cpp +++ b/tools/libclang/IndexingContext.cpp @@ -532,7 +532,6 @@ void IndexingContext::addContainerInMap(const DeclContext *DC, if (!DC) return; - assert(getScopedContext(DC) == DC); ContainerMapTy::iterator I = ContainerMap.find(DC); if (I == ContainerMap.end()) { if (container) @@ -642,32 +641,11 @@ IndexingContext::getEntityContainer(const Decl *D) const { return DC; } -const DeclContext * -IndexingContext::getScopedContext(const DeclContext *DC) const { - // Local contexts are ignored for indexing. - const DeclContext *FuncCtx = cast<Decl>(DC)->getParentFunctionOrMethod(); - if (FuncCtx) - return FuncCtx; - - // We consider enums always scoped for indexing. - if (isa<TagDecl>(DC)) - return DC; - - if (const NamespaceDecl *NS = dyn_cast<NamespaceDecl>(DC)) { - if (NS->isAnonymousNamespace()) - return getScopedContext(NS->getParent()); - return NS; - } - - return DC->getRedeclContext(); -} - CXIdxClientContainer IndexingContext::getClientContainerForDC(const DeclContext *DC) const { if (!DC) return 0; - DC = getScopedContext(DC); ContainerMapTy::const_iterator I = ContainerMap.find(DC); if (I == ContainerMap.end()) return 0; diff --git a/tools/libclang/IndexingContext.h b/tools/libclang/IndexingContext.h index bce3ab33f0..64e3a3c5d4 100644 --- a/tools/libclang/IndexingContext.h +++ b/tools/libclang/IndexingContext.h @@ -428,12 +428,6 @@ private: const DeclContext *getEntityContainer(const Decl *D) const; - CXIdxClientContainer getClientContainer(const NamedDecl *D) const { - return getClientContainerForDC(D->getDeclContext()); - } - - const DeclContext *getScopedContext(const DeclContext *DC) const; - CXIdxClientFile getIndexFile(const FileEntry *File); CXIdxLoc getIndexLoc(SourceLocation Loc) const; |