[PATCH] D124253: [Clang][OpenMP] Fix the issue that one temp cubin file is not removed after compilation
Shilei Tian via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 22 13:07:51 PDT 2022
tianshilei1992 updated this revision to Diff 424589.
tianshilei1992 added a comment.
Herald added a subscriber: MaskRay.
update
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124253/new/
https://reviews.llvm.org/D124253
Files:
clang/lib/Driver/ToolChains/Cuda.cpp
Index: clang/lib/Driver/ToolChains/Cuda.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Cuda.cpp
+++ clang/lib/Driver/ToolChains/Cuda.cpp
@@ -447,7 +447,10 @@
CmdArgs.push_back("--gpu-name");
CmdArgs.push_back(Args.MakeArgString(CudaArchToString(gpu_arch)));
CmdArgs.push_back("--output-file");
- CmdArgs.push_back(Args.MakeArgString(TC.getInputFilename(Output)));
+ const char *OutputFileName = Args.MakeArgString(TC.getInputFilename(Output));
+ if (std::string(OutputFileName) != std::string(Output.getFilename()))
+ C.addTempFile(OutputFileName);
+ CmdArgs.push_back(OutputFileName);
for (const auto& II : Inputs)
CmdArgs.push_back(Args.MakeArgString(II.getFilename()));
@@ -606,8 +609,8 @@
if (!II.isFilename())
continue;
- const char *CubinF = C.addTempFile(
- C.getArgs().MakeArgString(getToolChain().getInputFilename(II)));
+ const char *CubinF =
+ C.getArgs().MakeArgString(getToolChain().getInputFilename(II));
CmdArgs.push_back(CubinF);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124253.424589.patch
Type: text/x-patch
Size: 1075 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220422/10b84b4c/attachment-0001.bin>
More information about the cfe-commits
mailing list