clang  15.0.0git
Classes | Public Member Functions | List of all members
clang::tooling::dependencies::DependencyScanningWorkerFilesystem Class Reference

A virtual file system optimized for the dependency discovery. More...

#include "clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h"

Inheritance diagram for clang::tooling::dependencies::DependencyScanningWorkerFilesystem:
Inheritance graph
[legend]
Collaboration diagram for clang::tooling::dependencies::DependencyScanningWorkerFilesystem:
Collaboration graph
[legend]

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
 
llvm::ErrorOr< EntryRefgetOrCreateFileSystemEntry (StringRef Filename, bool DisableDirectivesScanning=false)
 Returns entry for the given filename. More...
 

Detailed Description

A virtual file system optimized for the dependency discovery.

It is primarily designed to work with source files whose contents was 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 281 of file DependencyScanningFilesystem.h.

Constructor & Destructor Documentation

◆ DependencyScanningWorkerFilesystem()

clang::tooling::dependencies::DependencyScanningWorkerFilesystem::DependencyScanningWorkerFilesystem ( DependencyScanningFilesystemSharedCache SharedCache,
IntrusiveRefCntPtr< llvm::vfs::FileSystem >  FS 
)
inline

Definition at line 283 of file DependencyScanningFilesystem.h.

Member Function Documentation

◆ getOrCreateFileSystemEntry()

llvm::ErrorOr< EntryRef > DependencyScanningWorkerFilesystem::getOrCreateFileSystemEntry ( StringRef  Filename,
bool  DisableDirectivesScanning = false 
)

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 241 of file DependencyScanningFilesystem.cpp.

References Filename.

◆ openFileForRead()

llvm::ErrorOr< std::unique_ptr< llvm::vfs::File > > DependencyScanningWorkerFilesystem::openFileForRead ( const Twine &  Path)
override

◆ status()

llvm::ErrorOr< llvm::vfs::Status > DependencyScanningWorkerFilesystem::status ( const Twine &  Path)
override

Definition at line 256 of file DependencyScanningFilesystem.cpp.

References Filename.


The documentation for this class was generated from the following files: