aboutsummaryrefslogtreecommitdiff
path: root/tools/libclang/IndexingContext.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-12-08 00:54:07 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-12-08 00:54:07 +0000
commitbb7f5420bdd670969a02d0db33cac51633f5651b (patch)
treee641146efd99ed6d652684166a7fd28bc95bef87 /tools/libclang/IndexingContext.cpp
parent8cd0d25df91d7172bfd0ed6013f89ad0083ce301 (diff)
[libclang] Remove IndexingContext's getScopedContext(), it's not useful
now that client containers can be set via function calls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146117 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/IndexingContext.cpp')
-rw-r--r--tools/libclang/IndexingContext.cpp22
1 files changed, 0 insertions, 22 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;