yvvan updated this revision to Diff 149249.
yvvan added a comment.
This is the proper fix. When we get a buffer for main file we should use the
UserFilesAreVolatile flag to specify if memory mapping needs to occur or not.
https://reviews.llvm.org/D47460
Files:
lib/Frontend/ASTUnit.cpp
Inde
yvvan added a comment.
Memory mapping locks the file on Windows. That means that in the addressed case
it locks main file which we are editing. After that happens many tools struggle
to do something with this file, for example git.
It's the quickest solution, probably not the best. Better one wo
ilya-biryukov requested changes to this revision.
ilya-biryukov added a comment.
This revision now requires changes to proceed.
It's a very subtle change and it isn't clear if that's the right thing to do
without understanding the problem that we're trying to solve.
Could you please elaborate on
yvvan added a comment.
The precise path which leads here is yet unclear for me (it requires much more
time to research) but changing this specific default value to true fixes main
file from being memory mapped and therefore being blocked (on Windows)
I assume it comes from FileManager::getBuffer
yvvan created this revision.
yvvan added reviewers: ilya-biryukov, nik, klimek, bkramer.
Prevent accidental memory mapping for main file which sometimes happens through
FileSystem::getBufferForFile
https://reviews.llvm.org/D47460
Files:
include/clang/Basic/VirtualFileSystem.h
Index: includ