clang 20.0.0git
|
A virtual file system optimized for the dependency discovery. More...
#include "clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h"
Public Member Functions | |
DependencyScanningWorkerFilesystem (DependencyScanningFilesystemSharedCache &SharedCache, IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS) | |
llvm::ErrorOr< llvm::vfs::Status > | status (const Twine &Path) override |
llvm::ErrorOr< std::unique_ptr< llvm::vfs::File > > | openFileForRead (const Twine &Path) override |
std::error_code | getRealPath (const Twine &Path, SmallVectorImpl< char > &Output) override |
std::error_code | setCurrentWorkingDirectory (const Twine &Path) override |
void | resetBypassedPathPrefix () |
Make it so that no paths bypass this VFS. | |
void | setBypassedPathPrefix (StringRef Prefix) |
Set the prefix for paths that should bypass this VFS and go straight to the underlying VFS. | |
llvm::ErrorOr< EntryRef > | getOrCreateFileSystemEntry (StringRef Filename) |
Returns entry for the given filename. | |
bool | ensureDirectiveTokensArePopulated (EntryRef Entry) |
Ensure the directive tokens are populated for this file entry. | |
bool | exists (const Twine &Path) override |
Check whether Path exists. | |
Static Public Attributes | |
static const char | ID = 0 |
A virtual file system optimized for the dependency discovery.
It is primarily designed to work with source files whose contents was preprocessed to remove any tokens that are unlikely to affect the dependency computation.
This is not a thread safe VFS. A single instance is meant to be used only in one thread. Multiple instances are allowed to service multiple threads running in parallel.
Definition at line 337 of file DependencyScanningFilesystem.h.
DependencyScanningWorkerFilesystem::DependencyScanningWorkerFilesystem | ( | DependencyScanningFilesystemSharedCache & | SharedCache, |
IntrusiveRefCntPtr< llvm::vfs::FileSystem > | FS | ||
) |
Definition at line 208 of file DependencyScanningFilesystem.cpp.
Ensure the directive tokens are populated for this file entry.
Returns true if the directive tokens are populated for this file entry, false if not (i.e. this entry is not a file or its scan fails).
Definition at line 44 of file DependencyScanningFilesystem.cpp.
References clang::tooling::dependencies::CachedFileContents::DepDirectives, clang::tooling::dependencies::CachedFileContents::DepDirectiveTokens, clang::tooling::dependencies::CachedFileContents::Original, clang::scanSourceForDependencyDirectives(), and clang::tooling::dependencies::CachedFileContents::ValueLock.
|
override |
Check whether Path
exists.
By default checks cached result of status()
, and falls back on FS if unable to do so.
Definition at line 298 of file DependencyScanningFilesystem.cpp.
llvm::ErrorOr< EntryRef > DependencyScanningWorkerFilesystem::getOrCreateFileSystemEntry | ( | StringRef | Filename | ) |
Returns entry for the given filename.
Attempts to use the local and shared caches first, then falls back to using the underlying filesystem.
Definition at line 268 of file DependencyScanningFilesystem.cpp.
References clang::tooling::dependencies::EntryRef::unwrapError().
Referenced by openFileForRead(), and status().
|
override |
Definition at line 370 of file DependencyScanningFilesystem.cpp.
References clang::tooling::dependencies::DependencyScanningFilesystemLocalCache::findRealPathByFilename(), clang::tooling::dependencies::DependencyScanningFilesystemSharedCache::getShardForFilename(), clang::tooling::dependencies::DependencyScanningFilesystemLocalCache::insertRealPathForFilename(), and Path.
|
override |
Definition at line 356 of file DependencyScanningFilesystem.cpp.
References Filename, getOrCreateFileSystemEntry(), Path, and clang::Result.
|
inline |
Make it so that no paths bypass this VFS.
Definition at line 357 of file DependencyScanningFilesystem.h.
|
inline |
Set the prefix for paths that should bypass this VFS and go straight to the underlying VFS.
Definition at line 360 of file DependencyScanningFilesystem.h.
|
override |
Definition at line 420 of file DependencyScanningFilesystem.cpp.
References Path.
|
override |
Definition at line 285 of file DependencyScanningFilesystem.cpp.
References Filename, getOrCreateFileSystemEntry(), Path, and clang::Result.
Referenced by exists().
|
static |
Definition at line 341 of file DependencyScanningFilesystem.h.