llvm-project/clang/unittests/Basic
Erik Verbruggen dfffaf579f FileManager: mark virtual file entries as valid entries
The getVirtualFile method would create entries for e.g. libclang's
CXUnsavedFile but not mark them as valid. The effect is that a lookup
through getFile where the file name is not exactly matching the virtual
file (e.g. through mixing slashes and backslashes on Windows) would
result in a normal file "lookup", and re-using the file entry found
by using the UniqueID, and overwrite the file entry fields. Because the
lookup involves opening the file, and moving it into the file entry, the
file is now open. The SourceManager keys its buffers on the UniqueID
(which is still the same), so it will find an already loaded buffer.
Because only the loading a buffer from disk will close the file, the
FileEntry will hold on to an open file for as long as the FileManager
is around. As the FileManager will only get destroyed at a reparse,
you can't safe to the "leaked" and locked file on Windows.

llvm-svn: 298905
2017-03-28 09:18:05 +00:00
..
CMakeLists.txt Reapply "Modules: Cache PCMs in memory and avoid a use-after-free" 2017-03-20 17:58:26 +00:00
CharInfoTest.cpp Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h. 2013-02-08 22:30:41 +00:00
DiagnosticTest.cpp Optionally demote fatal errors to non-fatal errors. 2016-03-01 10:56:19 +00:00
FileManagerTest.cpp FileManager: mark virtual file entries as valid entries 2017-03-28 09:18:05 +00:00
MemoryBufferCacheTest.cpp Modules: Remove an invalid check in unit tests for r298278 2017-03-21 18:26:18 +00:00
SourceManagerTest.cpp Reapply "Modules: Cache PCMs in memory and avoid a use-after-free" 2017-03-20 17:58:26 +00:00
VirtualFileSystemTest.cpp Add more debugging code for the SystemZ bot. 2017-03-14 17:46:26 +00:00