Lines Matching +full:class +full:- +full:dg

1 //===- IndexingAction.cpp - Frontend index action -------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
26 class IndexPPCallbacks final : public PPCallbacks {
35 IndexCtx->handleMacroReference(*MacroNameTok.getIdentifierInfo(), in MacroExpands()
41 IndexCtx->handleMacroDefined(*MacroNameTok.getIdentifierInfo(), in MacroDefined()
43 *MD->getMacroInfo()); in MacroDefined()
50 IndexCtx->handleMacroUndefined(*MacroNameTok.getIdentifierInfo(), in MacroUndefined()
60 IndexCtx->handleMacroReference(*MacroNameTok.getIdentifierInfo(), in Defined()
66 if (!MD.getMacroInfo()) // Ignore non-existent macro. in Ifdef()
68 IndexCtx->handleMacroReference(*MacroNameTok.getIdentifierInfo(), in Ifdef()
76 IndexCtx->handleMacroReference(*MacroNameTok.getIdentifierInfo(), in Ifndef()
85 if (!MD.getMacroInfo()) // Ignore non-existent macro. in Elifdef()
87 IndexCtx->handleMacroReference(*MacroNameTok.getIdentifierInfo(), in Elifdef()
93 if (!MD.getMacroInfo()) // Ignore non-existent macro. in Elifndef()
95 IndexCtx->handleMacroReference(*MacroNameTok.getIdentifierInfo(), in Elifndef()
101 class IndexASTConsumer final : public ASTConsumer {
113 IndexCtx(new IndexingContext(Opts, *this->DataConsumer)), in IndexASTConsumer()
116 assert(this->DataConsumer != nullptr); in IndexASTConsumer()
117 assert(this->PP != nullptr); in IndexASTConsumer()
122 IndexCtx->setASTContext(Context); in Initialize()
123 IndexCtx->getDataConsumer().initialize(Context); in Initialize()
124 IndexCtx->getDataConsumer().setPreprocessor(PP); in Initialize()
125 PP->addPPCallbacks(std::make_unique<IndexPPCallbacks>(IndexCtx)); in Initialize()
128 bool HandleTopLevelDecl(DeclGroupRef DG) override { in HandleTopLevelDecl() argument
129 return IndexCtx->indexDeclGroupRef(DG); in HandleTopLevelDecl()
132 void HandleInterestingDecl(DeclGroupRef DG) override { in HandleInterestingDecl() argument
136 void HandleTopLevelDeclInObjCContainer(DeclGroupRef DG) override { in HandleTopLevelDeclInObjCContainer() argument
137 IndexCtx->indexDeclGroupRef(DG); in HandleTopLevelDeclInObjCContainer()
141 DataConsumer->finish(); in HandleTranslationUnit()
149 class IndexAction final : public ASTFrontendAction {
157 assert(this->DataConsumer != nullptr); in IndexAction()
235 for (auto *MD = M.second.getLatest(); MD; MD = MD->getPrevious()) { in indexPreprocessorMacros()
236 indexPreprocessorMacro(M.first, MD->getMacroInfo(), MD->getKind(), in indexPreprocessorMacros()
237 MD->getLocation(), DataConsumer); in indexPreprocessorMacros()
248 auto *OwningMod = MM->getOwningModule(); in indexPreprocessorModuleMacros()
249 if (OwningMod && OwningMod->getASTFile() == Mod.File) { in indexPreprocessorModuleMacros()
250 if (auto *MI = MM->getMacroInfo()) { in indexPreprocessorModuleMacros()
252 MI->getDefinitionLoc(), DataConsumer); in indexPreprocessorModuleMacros()