[cfe-commits] r135690 - in /cfe/trunk/lib/Frontend: ASTUnit.cpp CompilerInstance.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Thu Jul 21 11:44:47 PDT 2011
Author: akirtzidis
Date: Thu Jul 21 13:44:46 2011
New Revision: 135690
URL: http://llvm.org/viewvc/llvm-project?rev=135690&view=rev
Log:
Cut down one open/close pair of system calls by using Path's makeUnique instead of createTemporaryFileOnDisk.
Modified:
cfe/trunk/lib/Frontend/ASTUnit.cpp
cfe/trunk/lib/Frontend/CompilerInstance.cpp
Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=135690&r1=135689&r2=135690&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Thu Jul 21 13:44:46 2011
@@ -1048,7 +1048,7 @@
P.createDirectoryOnDisk(true);
P.appendComponent("preamble");
P.appendSuffix("pch");
- if (P.createTemporaryFileOnDisk())
+ if (P.makeUnique(/*reuse_current=*/false, /*ErrMsg*/0))
return std::string();
return P.str();
Modified: cfe/trunk/lib/Frontend/CompilerInstance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=135690&r1=135689&r2=135690&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInstance.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInstance.cpp Thu Jul 21 13:44:46 2011
@@ -489,7 +489,7 @@
(OutPath.isRegularFile() && OutPath.canWrite())) {
// Create a temporary file.
llvm::sys::Path TempPath(OutFile);
- if (!TempPath.createTemporaryFileOnDisk())
+ if (!TempPath.makeUnique(/*reuse_current=*/false, /*ErrMsg*/0))
TempFile = TempPath.str();
}
}
More information about the cfe-commits
mailing list