From eb90a74c3e18c54da937f95d639824742d84af8f Mon Sep 17 00:00:00 2001 From: emankov Date: Thu, 27 Dec 2018 17:00:18 +0300 Subject: [PATCH] [HIPIFY] Use sys::fs::createTemporaryFile without file creation [Reasons] + File is opened further by clang + There is a regression with LLVM 5.x, when system error occurs: temporary file couldn't be renamed - permission denied. [ROCm/hip commit: 912c4710ed6cf82ebcde95bc0af9912f68d381e5] --- projects/hip/hipify-clang/src/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/projects/hip/hipify-clang/src/main.cpp b/projects/hip/hipify-clang/src/main.cpp index 7af894e16c..06981a9d70 100644 --- a/projects/hip/hipify-clang/src/main.cpp +++ b/projects/hip/hipify-clang/src/main.cpp @@ -123,7 +123,6 @@ int main(int argc, const char **argv) { if (PrintStats) { statPrint = &llvm::errs(); } - int FD; for (const auto & src : fileSources) { if (dst.empty()) { if (Inplace) { @@ -145,7 +144,7 @@ int main(int argc, const char **argv) { continue; } if (TemporaryDir.empty()) { - EC = sys::fs::createTemporaryFile(src, ext, FD, tmpFile); + EC = sys::fs::createTemporaryFile(src, ext, tmpFile); if (EC) { llvm::errs() << "\n" << sHipify << sError << EC.message() << ": " << tmpFile << "\n"; Result = 1;