Any reason not to do that on all platforms? While it works on unices, I think it's nicer to not do it there, too...
On Sun, May 27, 2012 at 2:59 PM, NAKAMURA Takumi <[email protected]>wrote: > Author: chapuni > Date: Sun May 27 07:59:58 2012 > New Revision: 157528 > > URL: http://llvm.org/viewvc/llvm-project?rev=157528&view=rev > Log: > clang/lib/Rewrite/Rewriter.cpp: Don't try to rename opened files on Win32. > Win32 doesn't allow rename/removing opened files. > > Modified: > cfe/trunk/lib/Rewrite/Rewriter.cpp > > Modified: cfe/trunk/lib/Rewrite/Rewriter.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/Rewriter.cpp?rev=157528&r1=157527&r2=157528&view=diff > > ============================================================================== > --- cfe/trunk/lib/Rewrite/Rewriter.cpp (original) > +++ cfe/trunk/lib/Rewrite/Rewriter.cpp Sun May 27 07:59:58 2012 > @@ -444,6 +444,10 @@ > 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; > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
