[PATCH] D30385: clang-format: Don't leave behind temp files in -i mode on Windows, PR26125, reloaded

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 27 10:51:58 PST 2017


Is that a "this patch is good" or a "please rewrite"?

On Mon, Feb 27, 2017 at 1:50 PM, Reid Kleckner via Phabricator <
reviews at reviews.llvm.org> wrote:

> rnk added a comment.
>
> My understanding is that Windows doesn't allow you to delete a file that
> has been opened and mapped into any process, even if it has been opened
> with FILE_SHARE_DELETE. One way to work around this would be to avoid
> memory mapping files in the SourceManager when using the Rewriter. Then
> FILE_SHARE_DELETE will do what you want. There should be a parameter to
> MemoryBuffer::getFile to control this. However, I think it really would be
> cleaner if we unmapped all of our MemoryBuffers of inputs before
> overwriting them in place. Keeping those buffers around feels like having
> dangling references.
>
>
> https://reviews.llvm.org/D30385
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170227/284da2a9/attachment-0001.html>


More information about the cfe-commits mailing list