1//===--- IndexingAction.h - Frontend index action -------------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10#ifndef LLVM_CLANG_INDEX_INDEXINGACTION_H 11#define LLVM_CLANG_INDEX_INDEXINGACTION_H 12 13#include "clang/Basic/LLVM.h" 14#include "llvm/ADT/ArrayRef.h" 15#include <memory> 16 17namespace clang { 18 class ASTContext; 19 class ASTReader; 20 class ASTUnit; 21 class Decl; 22 class FrontendAction; 23 24namespace serialization { 25 class ModuleFile; 26} 27 28namespace index { 29 class IndexDataConsumer; 30 31struct IndexingOptions { 32 enum class SystemSymbolFilterKind { 33 None, 34 DeclarationsOnly, 35 All, 36 }; 37 38 SystemSymbolFilterKind SystemSymbolFilter 39 = SystemSymbolFilterKind::DeclarationsOnly; 40 bool IndexFunctionLocals = false; 41}; 42 43/// \param WrappedAction another frontend action to wrap over or null. 44std::unique_ptr<FrontendAction> 45createIndexingAction(std::shared_ptr<IndexDataConsumer> DataConsumer, 46 IndexingOptions Opts, 47 std::unique_ptr<FrontendAction> WrappedAction); 48 49void indexASTUnit(ASTUnit &Unit, 50 std::shared_ptr<IndexDataConsumer> DataConsumer, 51 IndexingOptions Opts); 52 53void indexTopLevelDecls(ASTContext &Ctx, ArrayRef<const Decl *> Decls, 54 std::shared_ptr<IndexDataConsumer> DataConsumer, 55 IndexingOptions Opts); 56 57void indexModuleFile(serialization::ModuleFile &Mod, ASTReader &Reader, 58 std::shared_ptr<IndexDataConsumer> DataConsumer, 59 IndexingOptions Opts); 60 61} // namespace index 62} // namespace clang 63 64#endif 65