clang 8.0.0

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
clang::FileSystemStatCache Class Referenceabstract

Abstract interface for introducing a FileManager cache for 'stat' system calls, which is used by precompiled and pretokenized headers to improve performance. More...

`#include "clang/Basic/FileSystemStatCache.h"`

Inheritance diagram for clang::FileSystemStatCache:
[legend]

## Public Types
enum | LookupResult { CacheExists, CacheMissing }

## Public Member Functions
virtual | ~FileSystemStatCache ()=default

## Static Public Member Functions
static bool | get (StringRef Path, FileData &Data, bool isFile, std::unique_ptr< llvm::vfs::File > *F, FileSystemStatCache *Cache, llvm::vfs::FileSystem &FS)
| Get the 'stat' information for the specified path, using the cache to accelerate it if possible. More...

## Protected Member Functions
virtual LookupResult | getStat (StringRef Path, FileData &Data, bool isFile, std::unique_ptr< llvm::vfs::File > *F, llvm::vfs::FileSystem &FS)=0

## Detailed Description

Abstract interface for introducing a FileManager cache for 'stat' system calls, which is used by precompiled and pretokenized headers to improve performance.

Definition at line 60 of file FileSystemStatCache.h.

## Member Enumeration Documentation

## ◆ LookupResult

enum clang::FileSystemStatCache::LookupResult

Enumerator
CacheExists | We know the file exists and its cached stat data.
CacheMissing | We know that the file doesn't exist.

Definition at line 66 of file FileSystemStatCache.h.

## Constructor & Destructor Documentation

## ◆ ~FileSystemStatCache()

virtual clang::FileSystemStatCache::~FileSystemStatCache | ( |  | ) |
| virtual default

## Member Function Documentation

## ◆ get()

bool FileSystemStatCache::get | ( | StringRef | Path,
|  | FileData & | Data,
|  | bool | isFile,
|  | std::unique_ptr< llvm::vfs::File > * | F,
|  | FileSystemStatCache * | Cache,
|  | llvm::vfs::FileSystem & | FS
| ) |  |
| static

Get the 'stat' information for the specified path, using the cache to accelerate it if possible.

FileSystemStatCache::get - Get the 'stat' information for the specified path, using the cache to accelerate it if possible.

Returns
  `true` if the path does not exist or `false` if it exists.

If isFile is true, then this lookup should only return success for files (not directories). If it is false this lookup should only return success for directories (not files). On a successful file lookup, the implementation can optionally fill in `F` with a valid `File` object and the client guarantees that it will close it.

This returns true if the path does not exist or false if it exists.

If isFile is true, then this lookup should only return success for files (not directories). If it is false this lookup should only return success for directories (not files). On a successful file lookup, the implementation can optionally fill in FileDescriptor with a valid descriptor and the client guarantees that it will close it.

Definition at line 46 of file FileSystemStatCache.cpp.

References getStat().

Referenced by clang::FileManager::getBufferForFile().

## ◆ getStat()

virtual LookupResult clang::FileSystemStatCache::getStat | ( | StringRef | Path,
|  | FileData & | Data,
|  | bool | isFile,
|  | std::unique_ptr< llvm::vfs::File > * | F,
|  | llvm::vfs::FileSystem & | FS
| ) |  |
| protected pure virtual

Implemented in clang::MemorizeStatCalls.

Referenced by get().

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

- include/clang/Basic/FileSystemStatCache.h
- lib/Basic/FileSystemStatCache.cpp