aboutsummaryrefslogtreecommitdiff
path: root/lib/Rewrite
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2012-05-27 12:59:58 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2012-05-27 12:59:58 +0000
commit2d9c4dfad1f58c42a31721054cd99218d9ac3d52 (patch)
tree799987aba4c96350fff156234077d2d96018d539 /lib/Rewrite
parent9fd2359ee3b140557b808e4b79bc73a3b9d62304 (diff)
clang/lib/Rewrite/Rewriter.cpp: Don't try to rename opened files on Win32. Win32 doesn't allow rename/removing opened files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157528 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite')
-rw-r--r--lib/Rewrite/Rewriter.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Rewrite/Rewriter.cpp b/lib/Rewrite/Rewriter.cpp
index a2d03a12f7..f7b0154ef6 100644
--- a/lib/Rewrite/Rewriter.cpp
+++ b/lib/Rewrite/Rewriter.cpp
@@ -444,6 +444,10 @@ public:
if (!ok()) return;
FileStream->flush();
+#ifdef _WIN32
+ // Win32 does not allow rename/removing opened files.
+ FileStream.reset();
+#endif
if (llvm::error_code ec =
llvm::sys::fs::rename(TempFilename.str(), Filename)) {
AllWritten = false;