]> granicus.if.org Git - clang/commitdiff
clang/lib/Rewrite/Rewriter.cpp: Don't try to rename opened files on Win32. Win32...
authorNAKAMURA Takumi <geek4civic@gmail.com>
Sun, 27 May 2012 12:59:58 +0000 (12:59 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Sun, 27 May 2012 12:59:58 +0000 (12:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157528 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Rewrite/Rewriter.cpp

index a2d03a12f7b9c15ec489a71ff4dc321837ebb207..f7b0154ef6c358807f164f83280718f1156e5819 100644 (file)
@@ -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;