clang
7.0.0
|
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"
Public Types | |
enum | LookupResult { CacheExists, CacheMissing } |
Public Member Functions | |
virtual | ~FileSystemStatCache ()=default |
void | setNextStatCache (std::unique_ptr< FileSystemStatCache > Cache) |
Sets the next stat call cache in the chain of stat caches. More... | |
FileSystemStatCache * | getNextStatCache () |
Retrieve the next stat call cache in the chain. More... | |
std::unique_ptr< FileSystemStatCache > | takeNextStatCache () |
Retrieve the next stat call cache in the chain, transferring ownership of this cache (and, transitively, all of the remaining caches) to the caller. More... | |
Static Public Member Functions | |
static bool | get (StringRef Path, FileData &Data, bool isFile, std::unique_ptr< vfs::File > *F, FileSystemStatCache *Cache, 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< vfs::File > *F, vfs::FileSystem &FS)=0 |
LookupResult | statChained (StringRef Path, FileData &Data, bool isFile, std::unique_ptr< vfs::File > *F, vfs::FileSystem &FS) |
Protected Attributes | |
std::unique_ptr< FileSystemStatCache > | NextStatCache |
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 57 of file FileSystemStatCache.h.
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.
|
virtualdefault |
|
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.
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(), and getNextStatCache().
|
inline |
Retrieve the next stat call cache in the chain.
Definition at line 95 of file FileSystemStatCache.h.
References get().
Referenced by clang::FileManager::addStatCache(), and clang::FileManager::removeStatCache().
|
protectedpure virtual |
Implemented in clang::PTHStatCache, and clang::MemorizeStatCalls.
Referenced by get().
|
inline |
Sets the next stat call cache in the chain of stat caches.
Takes ownership of the given stat cache.
Definition at line 90 of file FileSystemStatCache.h.
Referenced by clang::FileManager::addStatCache(), and clang::FileManager::removeStatCache().
|
inlineprotected |
Definition at line 112 of file FileSystemStatCache.h.
Referenced by clang::MemorizeStatCalls::getStat().
|
inline |
Retrieve the next stat call cache in the chain, transferring ownership of this cache (and, transitively, all of the remaining caches) to the caller.
Definition at line 100 of file FileSystemStatCache.h.
Referenced by clang::FileManager::removeStatCache().
|
protected |
Definition at line 61 of file FileSystemStatCache.h.