9#ifndef LLVM_CLANG_DEPENDENCYSCANNING_DEPENDENCYSCANNINGSERVICE_H
10#define LLVM_CLANG_DEPENDENCYSCANNING_DEPENDENCYSCANNINGSERVICE_H
15#include "llvm/ADT/BitmaskEnum.h"
33#define DSS_LAST_BITMASK_ENUM(Id) \
34 LLVM_MARK_AS_BITMASK_ENUM(Id), All = llvm::NextPowerOf2(Id) - 1
62#undef DSS_LAST_BITMASK_ENUM
116 : Opts(
std::move(Opts)), Logger(this->Opts.LogPath) {
117 ModCacheEntries.ValidateAgainstInvalidatedPaths =
122 if (Opts.FlushModuleCache)
123 ModCacheEntries.flush();
144 assert(Opts.ValidateAgainstInvalidatedPaths &&
145 "invalidated paths are only checked when validating against them");
146 ModCacheEntries.addInvalidatedPath(Path);
Defines a logger where each line is written atomically to the file.
This class is a shared cache, that caches the 'stat' and 'open' calls to the underlying real file sys...
ModuleCacheEntries & getModuleCacheEntries()
const DependencyScanningServiceOptions & getOpts() const
void addInvalidatedPath(StringRef Path)
Add a path that changed since the previous scan, so that cached scanning modules depending on it are ...
AtomicLineLogger & getLogger()
DependencyScanningService(DependencyScanningServiceOptions Opts)
DependencyScanningFilesystemSharedCache & getSharedCache()
~DependencyScanningService()
@ VFS
Remove unused -ivfsoverlay arguments.
@ IgnoreCWD
Ignore the compiler's working directory if it is safe.
@ SystemWarnings
Remove warnings from system modules.
@ Macros
Canonicalize -D and -U options.
@ HeaderSearch
Remove unused header search paths including header maps.
bool shouldCacheNegativeStatsForPath(StringRef Path)
bool shouldCacheNegativeStatsDefault()
ScanningMode
The mode in which the dependency scanner will operate to find the dependencies.
@ DependencyDirectivesScan
This mode is used to compute the dependencies by running the preprocessor with special kind of lexing...
@ CanonicalPreprocessing
This mode is used to compute the dependencies by running the preprocessor over the source files.
Top level wrappers for InstallAPI frontend operations.
int const char * function
The configuration knobs for the dependency scanning service.
bool FlushModuleCache
Whether to automatically flush the module cache from memory to disk at the end of the service lifetim...
std::function< IntrusiveRefCntPtr< llvm::vfs::FileSystem >()> MakeVFS
The function invoked to create each worker's VFS.
bool AsyncScanModules
Whether to scan modules asynchronously.
ScanningMode Mode
Whether to use optimized dependency directive scan or full preprocessing.
bool ReportVisibleModules
Whether to report modules visible from modules that are imported directly.
bool ValidateAgainstInvalidatedPaths
Whether scanning modules validate their directory deps against paths reported via DependencyScanningS...
DependencyScanningServiceOptions()
bool EmitWarnings
Whether the scanner should emit warnings.
bool CacheNegativeStats
Whether the caching VFS should cache missing filesystem entries.
bool TraceVFS
Whether to trace VFS accesses during the scan.
std::string LogPath
The path to a log file, which logs timing of actions performed by the dependency scanner.
bool EagerLoadModules
Whether the resulting command lines should load explicit PCMs eagerly.
bool ReportAbsolutePaths
Whether to make reported file paths absolute.
std::time_t BuildSessionTimestamp
The build session timestamp for validate-once-per-build-session logic.
ScanningOptimizations OptimizeArgs
How to optimize resulting explicit module command lines.