aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/FileManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Basic/FileManager.cpp')
-rw-r--r--clang/lib/Basic/FileManager.cpp5
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;
}