IndexingOptions.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===--- IndexingOptions.h - Options for indexing ---------------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_CLANG_INDEX_INDEXINGOPTIONS_H
  14. #define LLVM_CLANG_INDEX_INDEXINGOPTIONS_H
  15. #include "clang/Frontend/FrontendOptions.h"
  16. #include <memory>
  17. #include <string>
  18. namespace clang {
  19. class Decl;
  20. namespace index {
  21. struct IndexingOptions {
  22. enum class SystemSymbolFilterKind {
  23. None,
  24. DeclarationsOnly,
  25. All,
  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. // 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. } // namespace index
  46. } // namespace clang
  47. #endif // LLVM_CLANG_INDEX_INDEXINGOPTIONS_H
  48. #ifdef __GNUC__
  49. #pragma GCC diagnostic pop
  50. #endif