[PATCH] D54995: [MemoryBuffer] Add the setter to be able to force disabled mmap

Ivan Donchevskii via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 3 04:09:08 PST 2018


yvvan added a comment.

In D54995#1316457 <https://reviews.llvm.org/D54995#1316457>, @ilya-biryukov wrote:

> In D54995#1316437 <https://reviews.llvm.org/D54995#1316437>, @yvvan wrote:
>
> > Ok, no global option.
> >  Why not placing your VolatileFSProvider in clang so that libclang could you it too?
>
>
> Would be happy to, will need to figure out what to do with PCH and PCM files first. However if we do this on clang level, I believe we should remove the `isVolatile` flag from the VFS interfaces in the first place.
>  It would be nice to not loose out on the opportunity to avoid fully loading the PCH files, but that obviously requires passing some flags into the VFS implementation or various hacks (matching on filenames/extensions?) to find out which files are PCHs. 
>  I actually don't know which approach to choose: on one hand, I'd really want to get rid of the isVolatile flag, on the other hand I'd really want to avoid loading large binary files into memory and that requires passing the flags.


I don't think removing the flag is a good idea since I can easily assume cases when user wants mmap and is ready to encounter locks. In our case it can be an IDE option which behavior to choose.
The ideal solution in my opinion would be to have isSystem(filename) in FileSystem class. And is based on system directories with which ASTUnit feeds the FileSystem for example.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54995/new/

https://reviews.llvm.org/D54995





More information about the cfe-commits mailing list