File indexing completed on 2026-05-10 08:37:11
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLVM_CLANG_TOOLING_DEPENDENCYSCANNING_DEPENDENCYSCANNINGSERVICE_H
0010 #define LLVM_CLANG_TOOLING_DEPENDENCYSCANNING_DEPENDENCYSCANNINGSERVICE_H
0011
0012 #include "clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h"
0013 #include "llvm/ADT/BitmaskEnum.h"
0014
0015 namespace clang {
0016 namespace tooling {
0017 namespace dependencies {
0018
0019
0020
0021 enum class ScanningMode {
0022
0023
0024 CanonicalPreprocessing,
0025
0026
0027
0028
0029 DependencyDirectivesScan,
0030 };
0031
0032
0033 enum class ScanningOutputFormat {
0034
0035
0036
0037 Make,
0038
0039
0040
0041 Full,
0042
0043
0044
0045 P1689,
0046 };
0047
0048 #define DSS_LAST_BITMASK_ENUM(Id) \
0049 LLVM_MARK_AS_BITMASK_ENUM(Id), All = llvm::NextPowerOf2(Id) - 1
0050
0051 enum class ScanningOptimizations {
0052 None = 0,
0053
0054
0055 HeaderSearch = 1,
0056
0057
0058 SystemWarnings = 2,
0059
0060
0061 VFS = 4,
0062
0063
0064 Macros = 8,
0065
0066 DSS_LAST_BITMASK_ENUM(Macros),
0067 Default = All
0068 };
0069
0070 #undef DSS_LAST_BITMASK_ENUM
0071
0072
0073
0074 class DependencyScanningService {
0075 public:
0076 DependencyScanningService(
0077 ScanningMode Mode, ScanningOutputFormat Format,
0078 ScanningOptimizations OptimizeArgs = ScanningOptimizations::Default,
0079 bool EagerLoadModules = false, bool TraceVFS = false);
0080
0081 ScanningMode getMode() const { return Mode; }
0082
0083 ScanningOutputFormat getFormat() const { return Format; }
0084
0085 ScanningOptimizations getOptimizeArgs() const { return OptimizeArgs; }
0086
0087 bool shouldEagerLoadModules() const { return EagerLoadModules; }
0088
0089 bool shouldTraceVFS() const { return TraceVFS; }
0090
0091 DependencyScanningFilesystemSharedCache &getSharedCache() {
0092 return SharedCache;
0093 }
0094
0095 private:
0096 const ScanningMode Mode;
0097 const ScanningOutputFormat Format;
0098
0099 const ScanningOptimizations OptimizeArgs;
0100
0101 const bool EagerLoadModules;
0102
0103 const bool TraceVFS;
0104
0105 DependencyScanningFilesystemSharedCache SharedCache;
0106 };
0107
0108 }
0109 }
0110 }
0111
0112 #endif