[HIP] Fix temporary files
authorYaxun (Sam) Liu <yaxun.liu@amd.com>
Tue, 7 Mar 2023 05:25:01 +0000 (00:25 -0500)
committerYaxun (Sam) Liu <yaxun.liu@amd.com>
Fri, 10 Mar 2023 02:41:58 +0000 (21:41 -0500)
commit1f8a3ce325be51a1004657b08a607825447fee1b
tree8262ad17853b8a33d2e8f7ea5feb2274d6494e84
parentd32f71a91a432db2d9ea32694a8308534b6697ec
[HIP] Fix temporary files

Currently HIP toolchain uses Driver::GetTemporaryDirectory to
create a temporary directory for some temporary files during
compilation. The temporary directories are not automatically
deleted after compilation. This slows down compilation
on Windows.

Switch to use GetTemporaryPath which only creates temporay
files which will be deleted automatically.

Keep the original input file name convention for Darwin host
toolchain since it is needed for deterministic binary
(https://reviews.llvm.org/D111269)

Fixes: SWDEV-386058

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D145509
clang/include/clang/Driver/Driver.h
clang/lib/Driver/Driver.cpp
clang/test/Driver/hip-link-bc-to-bc.hip
clang/test/Driver/hip-temps-linux.hip [new file with mode: 0644]
clang/test/Driver/hip-temps-windows.hip [new file with mode: 0644]