#include "clang/Index/IndexingAction.h"
#include "IndexingContext.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendAction.h"
#include "clang/Frontend/MultiplexConsumer.h"
#include "clang/Index/IndexDataConsumer.h"
#include "clang/Lex/PPCallbacks.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Serialization/ASTReader.h"
#include "llvm/ADT/STLExtras.h"
#include <memory>
usingnamespaceclang;
usingnamespaceclang::index;
namespace {
class IndexPPCallbacks final : public PPCallbacks { … };
class IndexASTConsumer final : public ASTConsumer { … };
class IndexAction final : public ASTFrontendAction { … };
}
std::unique_ptr<ASTConsumer> index::createIndexingASTConsumer(
std::shared_ptr<IndexDataConsumer> DataConsumer,
const IndexingOptions &Opts, std::shared_ptr<Preprocessor> PP,
std::function<bool(const Decl *)> ShouldSkipFunctionBody) { … }
std::unique_ptr<ASTConsumer> clang::index::createIndexingASTConsumer(
std::shared_ptr<IndexDataConsumer> DataConsumer,
const IndexingOptions &Opts, std::shared_ptr<Preprocessor> PP) { … }
std::unique_ptr<FrontendAction>
index::createIndexingAction(std::shared_ptr<IndexDataConsumer> DataConsumer,
const IndexingOptions &Opts) { … }
static bool topLevelDeclVisitor(void *context, const Decl *D) { … }
static void indexTranslationUnit(ASTUnit &Unit, IndexingContext &IndexCtx) { … }
static void indexPreprocessorMacro(const IdentifierInfo *II,
const MacroInfo *MI,
MacroDirective::Kind DirectiveKind,
SourceLocation Loc,
IndexDataConsumer &DataConsumer) { … }
static void indexPreprocessorMacros(Preprocessor &PP,
IndexDataConsumer &DataConsumer) { … }
static void indexPreprocessorModuleMacros(Preprocessor &PP,
serialization::ModuleFile &Mod,
IndexDataConsumer &DataConsumer) { … }
void index::indexASTUnit(ASTUnit &Unit, IndexDataConsumer &DataConsumer,
IndexingOptions Opts) { … }
void index::indexTopLevelDecls(ASTContext &Ctx, Preprocessor &PP,
ArrayRef<const Decl *> Decls,
IndexDataConsumer &DataConsumer,
IndexingOptions Opts) { … }
std::unique_ptr<PPCallbacks>
index::indexMacrosCallback(IndexDataConsumer &Consumer, IndexingOptions Opts) { … }
void index::indexModuleFile(serialization::ModuleFile &Mod, ASTReader &Reader,
IndexDataConsumer &DataConsumer,
IndexingOptions Opts) { … }