diff options
| author | Ben Langmuir <blangmuir@apple.com> | 2014-02-27 17:23:33 +0000 |
|---|---|---|
| committer | Ben Langmuir <blangmuir@apple.com> | 2014-02-27 17:23:33 +0000 |
| commit | cb258fa9e950a7261cd85394b7dfa96739ad7a2f (patch) | |
| tree | 1d932606ff885c67242e53e31640a0f29d96c8b5 /lib/Basic/FileManager.cpp | |
| parent | f1489d6854b1b0b8ea2396fffe192163c03d2671 (diff) | |
| download | clang-cb258fa9e950a7261cd85394b7dfa96739ad7a2f.tar.gz clang-cb258fa9e950a7261cd85394b7dfa96739ad7a2f.tar.bz2 clang-cb258fa9e950a7261cd85394b7dfa96739ad7a2f.tar.xz | |
Split FileEntry name vs. isValid
This is a small bit of refactoring in preparation for FileEntry owning
the storage for its own name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202412 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/FileManager.cpp')
| -rw-r--r-- | lib/Basic/FileManager.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Basic/FileManager.cpp b/lib/Basic/FileManager.cpp index efc08aac96..d019686b77 100644 --- a/lib/Basic/FileManager.cpp +++ b/lib/Basic/FileManager.cpp @@ -314,7 +314,7 @@ const FileEntry *FileManager::getFile(StringRef Filename, bool openFile, UniqueRealFiles.getFile(Data.UniqueID, Data.IsNamedPipe, Data.InPCH); NamedFileEnt.setValue(&UFE); - if (UFE.getName()) { // Already have an entry with this inode, return it. + if (UFE.isValid()) { // Already have an entry with this inode, return it. // If the stat process opened the file, close it to avoid a FD leak. if (F) delete F; @@ -331,6 +331,7 @@ const FileEntry *FileManager::getFile(StringRef Filename, bool openFile, UFE.Dir = DirInfo; UFE.UID = NextFileUID++; UFE.File.reset(F); + UFE.IsValid = true; return &UFE; } @@ -380,7 +381,7 @@ FileManager::getVirtualFile(StringRef Filename, off_t Size, UFE->closeFile(); // If we already have an entry with this inode, return it. - if (UFE->getName()) + if (UFE->isValid()) return UFE; } |
