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 | c8a71468b7a662f3926d5b0df2e8509013977d65 (patch) | |
tree | 3251642f3c9ffb3e3670e364e770e28d84f975a4 /clang/lib/Basic/FileManager.cpp | |
parent | 955fe6f6eda9a740dbaadb7a67a2fa48ceb88049 (diff) | |
download | llvm-c8a71468b7a662f3926d5b0df2e8509013977d65.zip llvm-c8a71468b7a662f3926d5b0df2e8509013977d65.tar.gz llvm-c8a71468b7a662f3926d5b0df2e8509013977d65.tar.bz2 |
Split FileEntry name vs. isValid
This is a small bit of refactoring in preparation for FileEntry owning
the storage for its own name.
llvm-svn: 202412
Diffstat (limited to 'clang/lib/Basic/FileManager.cpp')
-rw-r--r-- | clang/lib/Basic/FileManager.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp index efc08aa..d019686 100644 --- a/clang/lib/Basic/FileManager.cpp +++ b/clang/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; } |