clang API Documentation

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
clang::FileSystemStatCache Class Reference

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

#include <FileSystemStatCache.h>

Inheritance diagram for clang::FileSystemStatCache:
Inheritance graph
[legend]
Collaboration diagram for clang::FileSystemStatCache:
Collaboration graph
[legend]

List of all members.

Public Types

enum  LookupResult { CacheExists, CacheMissing }

Public Member Functions

virtual ~FileSystemStatCache ()
void setNextStatCache (FileSystemStatCache *Cache)
 Sets the next stat call cache in the chain of stat caches. Takes ownership of the given stat cache.
FileSystemStatCachegetNextStatCache ()
 Retrieve the next stat call cache in the chain.
FileSystemStatCachetakeNextStatCache ()
 Retrieve the next stat call cache in the chain, transferring ownership of this cache (and, transitively, all of the remaining caches) to the caller.

Static Public Member Functions

static bool get (const char *Path, struct stat &StatBuf, int *FileDescriptor, FileSystemStatCache *Cache)

Protected Member Functions

virtual LookupResult getStat (const char *Path, struct stat &StatBuf, int *FileDescriptor)=0
LookupResult statChained (const char *Path, struct stat &StatBuf, int *FileDescriptor)

Protected Attributes

OwningPtr< FileSystemStatCacheNextStatCache

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 28 of file FileSystemStatCache.h.


Member Enumeration Documentation

Enumerator:
CacheExists 
CacheMissing 

Definition at line 36 of file FileSystemStatCache.h.


Constructor & Destructor Documentation

virtual clang::FileSystemStatCache::~FileSystemStatCache ( ) [inline, virtual]

Definition at line 34 of file FileSystemStatCache.h.


Member Function Documentation

bool FileSystemStatCache::get ( const char *  Path,
struct stat &  StatBuf,
int *  FileDescriptor,
FileSystemStatCache Cache 
) [static]

FileSystemStatCache::get - Get the 'stat' information for the specified path, using the cache to accellerate it if possible. This returns true if the path does not exist or false if it exists.

If FileDescriptor is non-null, then this lookup should only return success for files (not directories). If it is null 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.

FileSystemStatCache::get - Get the 'stat' information for the specified path, using the cache to accelerate it if possible. This returns true if the path does not exist or false if it exists.

If FileDescriptor is non-null, then this lookup should only return success for files (not directories). If it is null 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 42 of file FileSystemStatCache.cpp.

References CacheExists, CacheMissing, getStat(), and S_ISDIR.

FileSystemStatCache* clang::FileSystemStatCache::getNextStatCache ( ) [inline]

Retrieve the next stat call cache in the chain.

Definition at line 61 of file FileSystemStatCache.h.

References NextStatCache.

Referenced by clang::FileManager::addStatCache(), clang::FileManager::removeStatCache(), and statChained().

virtual LookupResult clang::FileSystemStatCache::getStat ( const char *  Path,
struct stat &  StatBuf,
int *  FileDescriptor 
) [protected, pure virtual]

Implemented in clang::MemorizeStatCalls.

Referenced by get().

void clang::FileSystemStatCache::setNextStatCache ( FileSystemStatCache Cache) [inline]

Sets the next stat call cache in the chain of stat caches. Takes ownership of the given stat cache.

Definition at line 56 of file FileSystemStatCache.h.

References NextStatCache.

Referenced by clang::FileManager::addStatCache(), and clang::FileManager::removeStatCache().

LookupResult clang::FileSystemStatCache::statChained ( const char *  Path,
struct stat &  StatBuf,
int *  FileDescriptor 
) [inline, protected]

Definition at line 72 of file FileSystemStatCache.h.

References CacheExists, CacheMissing, and getNextStatCache().

Referenced by clang::MemorizeStatCalls::getStat().

FileSystemStatCache* clang::FileSystemStatCache::takeNextStatCache ( ) [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 66 of file FileSystemStatCache.h.

References NextStatCache.


Member Data Documentation

Definition at line 31 of file FileSystemStatCache.h.

Referenced by getNextStatCache(), setNextStatCache(), and takeNextStatCache().


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