From 2e8ac8a8cd68f9e1ba561def096048badbe76e42 Mon Sep 17 00:00:00 2001 From: jianghaibo Date: Tue, 16 Dec 2025 17:22:32 +0800 Subject: [PATCH] [Bugfix][InstrProf] Use createTemporaryFile instead of createUniqueFile Create temporary profdata files for automatic merging of profraw in the system's temporary directory. --- clang/lib/Frontend/CompilerInvocation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 72e18071ed7f..15b2e21d684f 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1528,8 +1528,8 @@ mergeAll(const SmallVectorImpl &FileNames, llvm::vfs::FileSystem &FS, int FD; llvm::SmallString<128> TempFileName; - EC = llvm::sys::fs::createUniqueFile("./autoconv-temp-%%%%%%.profdata", FD, - TempFileName); + EC = llvm::sys::fs::createTemporaryFile("autoconv-temp", "profdata", FD, + TempFileName); if(EC) return llvm::errorCodeToError(EC); llvm::raw_fd_ostream OF(FD, true); -- Gitee