]> granicus.if.org Git - clang/commitdiff
clang/GlobalModuleIndex: Don't open the same file twice. Use raw_fd_ostream(fd, ...
authorNAKAMURA Takumi <geek4civic@gmail.com>
Thu, 24 Jan 2013 08:20:11 +0000 (08:20 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Thu, 24 Jan 2013 08:20:11 +0000 (08:20 +0000)
FIXME: PathV2::unique_file() is assumed to open the file with binary mode on win32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173330 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Serialization/GlobalModuleIndex.cpp
test/Modules/global_index.m

index 3b60979e75cf8a7712c0fc3931b99104b72aba1d..1600e357dda9523637a9628579d19548a31e94e7 100644 (file)
@@ -507,9 +507,7 @@ GlobalModuleIndex::writeIndex(FileManager &FileMgr, StringRef Path) {
     return EC_IOError;
 
   // Open the temporary global index file for output.
-  std::string ErrorInfo;
-  llvm::raw_fd_ostream Out(IndexTmpPath.c_str(), ErrorInfo,
-                           llvm::raw_fd_ostream::F_Binary);
+  llvm::raw_fd_ostream Out(TmpFD, true);
   if (Out.has_error())
     return EC_IOError;
 
index 2af18c41b660d41347e068d01ca070a00a81a0aa..423e1113e4f126be58a141ce7ec5feeac85b08bc 100644 (file)
@@ -1,8 +1,6 @@
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fdisable-module-hash -fmodules -generate-module-index -F %S/Inputs %s -verify
 // RUN: ls %t|grep modules.idx
-// REQUIRES: shell
-// XFAIL: mingw32
 
 // expected-no-diagnostics
 @import DependsOnModule;