[clang] 66723a0 - [HIP] Suport LLVM Driver (#112249)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 14 12:43:42 PDT 2024
Author: Petr Hosek
Date: 2024-10-14T12:43:38-07:00
New Revision: 66723a07d8c5e83329a37766c4cccfc4dbe6bb67
URL: https://github.com/llvm/llvm-project/commit/66723a07d8c5e83329a37766c4cccfc4dbe6bb67
DIFF: https://github.com/llvm/llvm-project/commit/66723a07d8c5e83329a37766c4cccfc4dbe6bb67.diff
LOG: [HIP] Suport LLVM Driver (#112249)
This addresses an issue introduced in #112041.
Added:
Modified:
clang/lib/Driver/ToolChains/HIPUtility.cpp
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/HIPUtility.cpp b/clang/lib/Driver/ToolChains/HIPUtility.cpp
index d4d324fb339c45..9fe4f1e0e20965 100644
--- a/clang/lib/Driver/ToolChains/HIPUtility.cpp
+++ b/clang/lib/Driver/ToolChains/HIPUtility.cpp
@@ -340,6 +340,7 @@ void HIP::constructHIPFatbinCommand(Compilation &C, const JobAction &JA,
void HIP::constructGenerateObjFileFromHIPFatBinary(
Compilation &C, const InputInfo &Output, const InputInfoList &Inputs,
const ArgList &Args, const JobAction &JA, const Tool &T) {
+ const Driver &D = C.getDriver();
std::string Name = std::string(llvm::sys::path::stem(Output.getFilename()));
// Create Temp Object File Generator,
@@ -347,13 +348,13 @@ void HIP::constructGenerateObjFileFromHIPFatBinary(
// Keep them if save-temps is enabled.
const char *ObjinFile;
const char *BundleFile;
- if (C.getDriver().isSaveTempsEnabled()) {
+ if (D.isSaveTempsEnabled()) {
ObjinFile = C.getArgs().MakeArgString(Name + ".mcin");
BundleFile = C.getArgs().MakeArgString(Name + ".hipfb");
} else {
- auto TmpNameMcin = C.getDriver().GetTemporaryPath(Name, "mcin");
+ auto TmpNameMcin = D.GetTemporaryPath(Name, "mcin");
ObjinFile = C.addTempFile(C.getArgs().MakeArgString(TmpNameMcin));
- auto TmpNameFb = C.getDriver().GetTemporaryPath(Name, "hipfb");
+ auto TmpNameFb = D.GetTemporaryPath(Name, "hipfb");
BundleFile = C.addTempFile(C.getArgs().MakeArgString(TmpNameFb));
}
HIP::constructHIPFatbinCommand(C, JA, BundleFile, Inputs, Args, T);
@@ -456,7 +457,7 @@ void HIP::constructGenerateObjFileFromHIPFatBinary(
llvm::raw_fd_ostream Objf(ObjinFile, EC, llvm::sys::fs::OF_None);
if (EC) {
- C.getDriver().Diag(clang::diag::err_unable_to_make_temp) << EC.message();
+ D.Diag(clang::diag::err_unable_to_make_temp) << EC.message();
return;
}
@@ -466,7 +467,7 @@ void HIP::constructGenerateObjFileFromHIPFatBinary(
"-o", Output.getFilename(),
"-x", "assembler",
ObjinFile, "-c"};
- const char *Clang = Args.MakeArgString(C.getDriver().ClangExecutable);
C.addCommand(std::make_unique<Command>(JA, T, ResponseFileSupport::None(),
- Clang, McArgs, Inputs, Output));
+ D.getClangProgramPath(), McArgs,
+ Inputs, Output, D.getPrependArg()));
}
More information about the cfe-commits
mailing list