From 155cf0f3a6843314527ce342aa1bc32517eeab3c Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 5 Jul 2013 20:14:52 +0000 Subject: Use sys::fs::createTemporaryFile. llvm-svn: 185719 --- llvm/lib/Transforms/Instrumentation/DebugIR.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/Transforms/Instrumentation/DebugIR.cpp') diff --git a/llvm/lib/Transforms/Instrumentation/DebugIR.cpp b/llvm/lib/Transforms/Instrumentation/DebugIR.cpp index f4109eff4f5..b5bdc7560b6 100644 --- a/llvm/lib/Transforms/Instrumentation/DebugIR.cpp +++ b/llvm/lib/Transforms/Instrumentation/DebugIR.cpp @@ -504,10 +504,9 @@ bool DebugIR::updateExtension(StringRef NewExtension) { } void DebugIR::generateFilename(OwningPtr &fd) { - StringRef FileModel("debug-ir-%s%s%s%s.ll"); SmallVector 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); -- cgit v1.2.3