diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Support/GraphWriter.cpp | 3 | ||||
-rw-r--r-- | lib/Transforms/Instrumentation/DebugIR.cpp | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/Support/GraphWriter.cpp b/lib/Support/GraphWriter.cpp index 20214c7..64d2164 100644 --- a/lib/Support/GraphWriter.cpp +++ b/lib/Support/GraphWriter.cpp @@ -68,8 +68,7 @@ StringRef llvm::DOT::getColorString(unsigned ColorNumber) { std::string llvm::createGraphFilename(const Twine &Name, int &FD) { FD = -1; SmallString<128> Filename; - error_code EC = sys::fs::unique_file(Twine(Name) + "-%%%%%%%.dot", - FD, Filename); + error_code EC = sys::fs::createTemporaryFile(Name, "dot", FD, Filename); if (EC) { errs() << "Error: " << EC.message() << "\n"; return ""; diff --git a/lib/Transforms/Instrumentation/DebugIR.cpp b/lib/Transforms/Instrumentation/DebugIR.cpp index f4109ef..b5bdc75 100644 --- a/lib/Transforms/Instrumentation/DebugIR.cpp +++ b/lib/Transforms/Instrumentation/DebugIR.cpp @@ -504,10 +504,9 @@ bool DebugIR::updateExtension(StringRef NewExtension) { } 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); |