Cut down one open/close pair of system calls by using Path's makeUnique instead of createTemporaryFileOnDisk.
llvm-svn: 135690
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index d953573..f427f4ec 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -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();
}
}