[cfe-commits] r146117 - in /cfe/trunk/tools/libclang: IndexingContext.cpp IndexingContext.h

Argyrios Kyrtzidis akyrtzi at gmail.com
Wed Dec 7 16:54:07 PST 2011


Author: akirtzidis
Date: Wed Dec  7 18:54:07 2011
New Revision: 146117

URL: http://llvm.org/viewvc/llvm-project?rev=146117&view=rev
Log:
[libclang] Remove IndexingContext's getScopedContext(), it's not useful
now that client containers can be set via function calls.

Modified:
    cfe/trunk/tools/libclang/IndexingContext.cpp
    cfe/trunk/tools/libclang/IndexingContext.h

Modified: cfe/trunk/tools/libclang/IndexingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/IndexingContext.cpp?rev=146117&r1=146116&r2=146117&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/IndexingContext.cpp (original)
+++ cfe/trunk/tools/libclang/IndexingContext.cpp Wed Dec  7 18:54:07 2011
@@ -532,7 +532,6 @@
   if (!DC)
     return;
 
-  assert(getScopedContext(DC) == DC);
   ContainerMapTy::iterator I = ContainerMap.find(DC);
   if (I == ContainerMap.end()) {
     if (container)
@@ -642,32 +641,11 @@
   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;

Modified: cfe/trunk/tools/libclang/IndexingContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/IndexingContext.h?rev=146117&r1=146116&r2=146117&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/IndexingContext.h (original)
+++ cfe/trunk/tools/libclang/IndexingContext.h Wed Dec  7 18:54:07 2011
@@ -428,12 +428,6 @@
 
   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;





More information about the cfe-commits mailing list