[PATCH] D52620: Added Support for StatOnly Files in VFS.

UTKARSH SAXENA via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 28 05:40:30 PDT 2018


usaxena95 added a comment.

> it sounds like this is for record-replay.

Yes this is for record-replay purpose.

> What are these files in practice?

During loading a modules the files that were required to make the module are stat()ed and their sizes are used to verify that the module is still valid. There are occurrences of more stat() only files (apart from the use in modules) which I am not aware of.

> In the replayed compilation, we assume the accessed files are the same, is it safe to assume we never read files we previously stat()ed?

I would call it a requirement instead of an assumption. The replay must be exactly the same (even the file stats and reads). If Clang reads the file in replay which was only stat()ed during compilation, it indicates non-determinism or something wrong (in clang or FS).
We currently deal with such files by adding empty buffers for them based on this assumption/requirement only.

> it seems like this could also be achieved with an overlayFS adding a simple specialized FS that only provides the stat-only files. If this is a relatively niche feature, cramming it into InMemoryFileSystem may not be the best option. Any thoughts on the tradeoff here?

We can reuse the InMemoryFS to make another FS which just serves stat-only files. A tradeoff I can think of is: we might need to store a random buffer of required size to make final status of the file correct.


Repository:
  rC Clang

https://reviews.llvm.org/D52620





More information about the cfe-commits mailing list