[PATCH] D54455: [vfs] add 'Status::copyWithNewSize'

Alex Lorenz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 13 11:11:38 PST 2018


arphaman added a comment.

In https://reviews.llvm.org/D54455#1296763, @ilya-biryukov wrote:

> Sorry for joining in the middle of the conversation without the full context, but what is the use-case for status that were created with the wrong size that needs to be patched up?
>  It's clear what the function is doing operationally, but it's hard to see why would we want to change the size of the file, while leaving other things (like modification time, etc.) the same?


For this particular use case we would like to create a virtual file system that overrides file contents. So basically we are pretending that the file on disk has a completely different source text, which requires us to update the size in the `stat` to ensure that Clang doesn't think that the file has changed on disk when it will compare the size of the file's memory buffer and the size it has in the `stat` value.


Repository:
  rL LLVM

https://reviews.llvm.org/D54455





More information about the llvm-commits mailing list