diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-02-12 03:17:57 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-02-12 03:17:57 +0000 |
commit | 5d7e2e17810f2e848e38f30ddf648a1a4c0fbfa6 (patch) | |
tree | a685ee3fad871f9eba6c2d5f11d137b0546576d8 /clang/lib/Basic/FileManager.cpp | |
parent | 3f6c631ea11daf2bf727d9ae50dacd4382a7ac1b (diff) | |
download | bcm5719-llvm-5d7e2e17810f2e848e38f30ddf648a1a4c0fbfa6.tar.gz bcm5719-llvm-5d7e2e17810f2e848e38f30ddf648a1a4c0fbfa6.zip |
FileManager:
- set the 'StatSysCallCache' object using a setter method instead of
FileManager's constructor. This allows the cache to be installed after the
FileManager object is created.
- Add 'file mode' to FileEntry (useful for stat caching)
llvm-svn: 64351
Diffstat (limited to 'clang/lib/Basic/FileManager.cpp')
-rw-r--r-- | clang/lib/Basic/FileManager.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp index 2db605415dd..773d3666756 100644 --- a/clang/lib/Basic/FileManager.cpp +++ b/clang/lib/Basic/FileManager.cpp @@ -122,7 +122,8 @@ public: return const_cast<FileEntry&>( *UniqueFiles.insert(FileEntry(StatBuf.st_dev, - StatBuf.st_ino)).first); + StatBuf.st_ino, + StatBuf.st_mode)).first); } size_t size() { return UniqueFiles.size(); } @@ -134,11 +135,10 @@ public: // Common logic. //===----------------------------------------------------------------------===// -FileManager::FileManager(StatSysCallCache* statCache) +FileManager::FileManager() : UniqueDirs(*new UniqueDirContainer), UniqueFiles(*new UniqueFileContainer), - DirEntries(64), FileEntries(64), NextFileUID(0), - StatCache(statCache) { + DirEntries(64), FileEntries(64), NextFileUID(0) { NumDirLookups = NumFileLookups = 0; NumDirCacheMisses = NumFileCacheMisses = 0; } @@ -146,10 +146,8 @@ FileManager::FileManager(StatSysCallCache* statCache) FileManager::~FileManager() { delete &UniqueDirs; delete &UniqueFiles; - delete StatCache; } - /// getDirectory - Lookup, cache, and verify the specified directory. This /// returns null if the directory doesn't exist. /// |