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

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.  This time, load the whole input file into memory instead of
using mmap when formatting in-place.

(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


git-svn-id: svn://svn.chromium.org/llvm-project/cfe/trunk/tools/clang-format@296408 0b72dbe1-c17f-4bc7-b9db-2b4152be0356
1 file changed