diff options
Diffstat (limited to 'clang/tools/libclang')
-rw-r--r-- | clang/tools/libclang/IndexDecl.cpp | 16 | ||||
-rw-r--r-- | clang/tools/libclang/Indexing.cpp | 5 | ||||
-rw-r--r-- | clang/tools/libclang/IndexingContext.h | 7 |
3 files changed, 2 insertions, 26 deletions
diff --git a/clang/tools/libclang/IndexDecl.cpp b/clang/tools/libclang/IndexDecl.cpp index c8cf1d36214..aa97129c23f 100644 --- a/clang/tools/libclang/IndexDecl.cpp +++ b/clang/tools/libclang/IndexDecl.cpp @@ -136,7 +136,6 @@ public: IndexCtx.handleObjCInterface(D); if (D->isThisDeclarationADefinition()) { - IndexCtx.indexTUDeclsInObjCContainer(); IndexCtx.indexDeclContext(D); } return true; @@ -146,7 +145,6 @@ public: IndexCtx.handleObjCProtocol(D); if (D->isThisDeclarationADefinition()) { - IndexCtx.indexTUDeclsInObjCContainer(); IndexCtx.indexDeclContext(D); } return true; @@ -162,8 +160,6 @@ public: IndexCtx.handleObjCImplementation(D); - IndexCtx.indexTUDeclsInObjCContainer(); - // Index the ivars first to make sure the synthesized ivars are indexed // before indexing the methods that can reference them. for (const auto *IvarI : D->ivars()) @@ -178,8 +174,6 @@ public: bool VisitObjCCategoryDecl(const ObjCCategoryDecl *D) { IndexCtx.handleObjCCategory(D); - - IndexCtx.indexTUDeclsInObjCContainer(); IndexCtx.indexDeclContext(D); return true; } @@ -190,8 +184,6 @@ public: return true; IndexCtx.handleObjCCategoryImpl(D); - - IndexCtx.indexTUDeclsInObjCContainer(); IndexCtx.indexDeclContext(D); return true; } @@ -347,11 +339,3 @@ void IndexingContext::indexDeclGroupRef(DeclGroupRef DG) { for (DeclGroupRef::iterator I = DG.begin(), E = DG.end(); I != E; ++I) indexTopLevelDecl(*I); } - -void IndexingContext::indexTUDeclsInObjCContainer() { - while (!TUDeclsInObjCContainer.empty()) { - DeclGroupRef DG = TUDeclsInObjCContainer.front(); - TUDeclsInObjCContainer.pop_front(); - indexDeclGroupRef(DG); - } -} diff --git a/clang/tools/libclang/Indexing.cpp b/clang/tools/libclang/Indexing.cpp index d6e35b0019c..4929d6244e5 100644 --- a/clang/tools/libclang/Indexing.cpp +++ b/clang/tools/libclang/Indexing.cpp @@ -327,9 +327,8 @@ public: /// \brief Handle the specified top-level declaration that occurred inside /// and ObjC container. - void HandleTopLevelDeclInObjCContainer(DeclGroupRef D) override { - // They will be handled after the interface is seen first. - IndexCtx.addTUDeclInObjCContainer(D); + void HandleTopLevelDeclInObjCContainer(DeclGroupRef DG) override { + IndexCtx.indexDeclGroupRef(DG); } /// \brief This is called by the AST reader when deserializing things. diff --git a/clang/tools/libclang/IndexingContext.h b/clang/tools/libclang/IndexingContext.h index 2b1355ad32a..d1d62c90d45 100644 --- a/clang/tools/libclang/IndexingContext.h +++ b/clang/tools/libclang/IndexingContext.h @@ -292,8 +292,6 @@ class IndexingContext { typedef std::pair<const FileEntry *, const Decl *> RefFileOccurrence; llvm::DenseSet<RefFileOccurrence> RefFileOccurrences; - std::deque<DeclGroupRef> TUDeclsInObjCContainer; - llvm::BumpPtrAllocator StrScratch; unsigned StrAdapterCount; friend class ScratchAlloc; @@ -446,13 +444,8 @@ public: bool isNotFromSourceFile(SourceLocation Loc) const; void indexTopLevelDecl(const Decl *D); - void indexTUDeclsInObjCContainer(); void indexDeclGroupRef(DeclGroupRef DG); - void addTUDeclInObjCContainer(DeclGroupRef DG) { - TUDeclsInObjCContainer.push_back(DG); - } - void translateLoc(SourceLocation Loc, CXIdxClientFile *indexFile, CXFile *file, unsigned *line, unsigned *column, unsigned *offset); |