• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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   // Whether to index macro definitions in the Preprocesor when preprocessor
32   // callback is not available (e.g. after parsing has finished). Note that
33   // macro references are not available in Proprocessor.
34   bool IndexMacrosInPreprocessor = false;
35   // Has no effect if IndexFunctionLocals are false.
36   bool IndexParametersInDeclarations = false;
37   bool IndexTemplateParameters = false;
38 
39   // If set, skip indexing inside some declarations for performance.
40   // This prevents traversal, so skipping a struct means its declaration an
41   // members won't be indexed, but references elsewhere to that struct will be.
42   // Currently this is only checked for top-level declarations.
43   std::function<bool(const Decl *)> ShouldTraverseDecl;
44 };
45 
46 } // namespace index
47 } // namespace clang
48 
49 #endif // LLVM_CLANG_INDEX_INDEXINGOPTIONS_H
50