Use sys::fs::createTemporaryFile.
llvm-svn: 185719
diff --git a/llvm/lib/Transforms/Instrumentation/DebugIR.cpp b/llvm/lib/Transforms/Instrumentation/DebugIR.cpp
index f4109eff..b5bdc75 100644
--- a/llvm/lib/Transforms/Instrumentation/DebugIR.cpp
+++ b/llvm/lib/Transforms/Instrumentation/DebugIR.cpp
@@ -504,10 +504,9 @@
}
void DebugIR::generateFilename(OwningPtr<int> &fd) {
- StringRef FileModel("debug-ir-%s%s%s%s.ll");
SmallVector<char, 16> PathVec;
fd.reset(new int);
- sys::fs::unique_file(FileModel, *fd, PathVec);
+ sys::fs::createTemporaryFile("debug-ir", "ll", *fd, PathVec);
StringRef Path(PathVec.data(), PathVec.size());
Filename = sys::path::filename(Path);
sys::path::remove_filename(PathVec);