1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | #ifndef LLVM_CLANG_INDEX_INDEXINGACTION_H |
10 | #define LLVM_CLANG_INDEX_INDEXINGACTION_H |
11 | |
12 | #include "clang/Basic/LLVM.h" |
13 | #include "clang/Lex/PPCallbacks.h" |
14 | #include "clang/Lex/Preprocessor.h" |
15 | #include "llvm/ADT/ArrayRef.h" |
16 | #include <memory> |
17 | |
18 | namespace clang { |
19 | class ASTContext; |
20 | class ASTReader; |
21 | class ASTUnit; |
22 | class Decl; |
23 | class FrontendAction; |
24 | |
25 | namespace serialization { |
26 | class ModuleFile; |
27 | } |
28 | |
29 | namespace index { |
30 | class IndexDataConsumer; |
31 | |
32 | struct IndexingOptions { |
33 | enum class SystemSymbolFilterKind { |
34 | None, |
35 | DeclarationsOnly, |
36 | All, |
37 | }; |
38 | |
39 | SystemSymbolFilterKind SystemSymbolFilter |
40 | = SystemSymbolFilterKind::DeclarationsOnly; |
41 | bool IndexFunctionLocals = false; |
42 | bool IndexImplicitInstantiation = false; |
43 | |
44 | |
45 | |
46 | bool IndexMacrosInPreprocessor = false; |
47 | |
48 | bool IndexParametersInDeclarations = false; |
49 | bool IndexTemplateParameters = false; |
50 | }; |
51 | |
52 | |
53 | |
54 | std::unique_ptr<FrontendAction> |
55 | createIndexingAction(std::shared_ptr<IndexDataConsumer> DataConsumer, |
56 | IndexingOptions Opts, |
57 | std::unique_ptr<FrontendAction> WrappedAction); |
58 | |
59 | |
60 | void indexASTUnit(ASTUnit &Unit, IndexDataConsumer &DataConsumer, |
61 | IndexingOptions Opts); |
62 | |
63 | |
64 | void indexTopLevelDecls(ASTContext &Ctx, Preprocessor &PP, |
65 | ArrayRef<const Decl *> Decls, |
66 | IndexDataConsumer &DataConsumer, IndexingOptions Opts); |
67 | |
68 | |
69 | |
70 | std::unique_ptr<PPCallbacks> indexMacrosCallback(IndexDataConsumer &Consumer, |
71 | IndexingOptions Opts); |
72 | |
73 | |
74 | void indexModuleFile(serialization::ModuleFile &Mod, ASTReader &Reader, |
75 | IndexDataConsumer &DataConsumer, IndexingOptions Opts); |
76 | |
77 | } |
78 | } |
79 | |
80 | #endif |
81 | |