xref: /freebsd/contrib/llvm-project/clang/include/clang/Index/IndexingOptions.h (revision 81ad626541db97eb356e2c1d4a20eb2a26a766ab)
1 //===--- IndexingOptions.h - Options for indexing ---------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_CLANG_INDEX_INDEXINGOPTIONS_H
10 #define LLVM_CLANG_INDEX_INDEXINGOPTIONS_H
11 
12 #include "clang/Frontend/FrontendOptions.h"
13 #include <memory>
14 #include <string>
15 
16 namespace clang {
17 class Decl;
18 namespace index {
19 
20 struct IndexingOptions {
21   enum class SystemSymbolFilterKind {
22     None,
23     DeclarationsOnly,
24     All,
25   };
26 
27   SystemSymbolFilterKind SystemSymbolFilter =
28       SystemSymbolFilterKind::DeclarationsOnly;
29   bool IndexFunctionLocals = false;
30   bool IndexImplicitInstantiation = false;
31   bool IndexMacros = true;
32   // Whether to index macro definitions in the Preprocessor when preprocessor
33   // callback is not available (e.g. after parsing has finished). Note that
34   // macro references are not available in Preprocessor.
35   bool IndexMacrosInPreprocessor = false;
36   // Has no effect if IndexFunctionLocals are false.
37   bool IndexParametersInDeclarations = false;
38   bool IndexTemplateParameters = false;
39 
40   // If set, skip indexing inside some declarations for performance.
41   // This prevents traversal, so skipping a struct means its declaration an
42   // members won't be indexed, but references elsewhere to that struct will be.
43   // Currently this is only checked for top-level declarations.
44   std::function<bool(const Decl *)> ShouldTraverseDecl;
45 };
46 
47 } // namespace index
48 } // namespace clang
49 
50 #endif // LLVM_CLANG_INDEX_INDEXINGOPTIONS_H
51