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

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 26 16:56:51 PST 2017


thakis created this revision.
Herald added a subscriber: klimek.

Second attempt after http://llvm.org/viewvc/llvm-project?rev=296166&view=rev

In the first attempt, `Code` (the memory buffer backing the input file) was reset before `overwriteChangedFiles()` was called, but `overwriteChangedFiles()` still reads from it.  Now, give `overwriteChangedFiles()` a callback that's called after the input's been read but before the output's written, and then call `Code.reset()` from that callback.

(Since the test is identical to what was in the repo before chapuni's revert, `svn diff` doesn't show it – see the above link for the test.)


https://reviews.llvm.org/D30385

Files:
  include/clang/Rewrite/Core/Rewriter.h
  lib/Frontend/Rewrite/FixItRewriter.cpp
  lib/Rewrite/Rewriter.cpp
  lib/Tooling/Refactoring.cpp
  test/Format/inplace.cpp
  tools/clang-format/ClangFormat.cpp
  unittests/Tooling/RefactoringTest.cpp
  unittests/Tooling/RewriterTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30385.89823.patch
Type: text/x-patch
Size: 5837 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170227/00cda035/attachment.bin>


More information about the cfe-commits mailing list