]> granicus.if.org Git - clang/commit
[Frontend] Close open file handles before renaming output files
authorReid Kleckner <reid@kleckner.net>
Fri, 10 Apr 2015 17:27:58 +0000 (17:27 +0000)
committerReid Kleckner <reid@kleckner.net>
Fri, 10 Apr 2015 17:27:58 +0000 (17:27 +0000)
commitbcae33fb115d7ac4784321e4bdecab72b0af8ef2
tree0fca80b5ac9f38340148dfa37b90170cea7b7400
parent16af28a092dbf9e87d4b0cb5075fd9bb8f06e9ee
[Frontend] Close open file handles before renaming output files

The placement of the 'delete' call that was removed in the unique_ptr
migration in r234597 was not an accident. The raw_ostream has to be
destroyed before you do the rename on Windows, otherwise you get
ERROR_ACCESS_DENIED. We can still use unique_ptr, we just need to do a
manual reset().

Also, range-for-loop-ify this code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234612 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Frontend/CompilerInstance.cpp