IndexCtx.handleObjCInterface(D);
if (D->isThisDeclarationADefinition()) {
- IndexCtx.indexTUDeclsInObjCContainer();
IndexCtx.indexDeclContext(D);
}
return true;
IndexCtx.handleObjCProtocol(D);
if (D->isThisDeclarationADefinition()) {
- IndexCtx.indexTUDeclsInObjCContainer();
IndexCtx.indexDeclContext(D);
}
return true;
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())
bool VisitObjCCategoryDecl(const ObjCCategoryDecl *D) {
IndexCtx.handleObjCCategory(D);
-
- IndexCtx.indexTUDeclsInObjCContainer();
IndexCtx.indexDeclContext(D);
return true;
}
return true;
IndexCtx.handleObjCCategoryImpl(D);
-
- IndexCtx.indexTUDeclsInObjCContainer();
IndexCtx.indexDeclContext(D);
return true;
}
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);
- }
-}
/// \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.
typedef std::pair<const FileEntry *, const Decl *> RefFileOccurrence;
llvm::DenseSet<RefFileOccurrence> RefFileOccurrences;
- std::deque<DeclGroupRef> TUDeclsInObjCContainer;
-
llvm::BumpPtrAllocator StrScratch;
unsigned StrAdapterCount;
friend class ScratchAlloc;
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);