From cb258fa9e950a7261cd85394b7dfa96739ad7a2f Mon Sep 17 00:00:00 2001 From: Ben Langmuir Date: Thu, 27 Feb 2014 17:23:33 +0000 Subject: 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 --- lib/Basic/FileManager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/Basic/FileManager.cpp') 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; } -- cgit v1.2.3