Skip to content

Commit 30407a8

Browse files
petrhosekDanielCChen
authored andcommitted
[HIP] Suport LLVM Driver (llvm#112249)
This addresses an issue introduced in llvm#112041.
1 parent 575cb92 commit 30407a8

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

clang/lib/Driver/ToolChains/HIPUtility.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,20 +340,21 @@ void HIP::constructHIPFatbinCommand(Compilation &C, const JobAction &JA,
340340
void HIP::constructGenerateObjFileFromHIPFatBinary(
341341
Compilation &C, const InputInfo &Output, const InputInfoList &Inputs,
342342
const ArgList &Args, const JobAction &JA, const Tool &T) {
343+
const Driver &D = C.getDriver();
343344
std::string Name = std::string(llvm::sys::path::stem(Output.getFilename()));
344345

345346
// Create Temp Object File Generator,
346347
// Offload Bundled file and Bundled Object file.
347348
// Keep them if save-temps is enabled.
348349
const char *ObjinFile;
349350
const char *BundleFile;
350-
if (C.getDriver().isSaveTempsEnabled()) {
351+
if (D.isSaveTempsEnabled()) {
351352
ObjinFile = C.getArgs().MakeArgString(Name + ".mcin");
352353
BundleFile = C.getArgs().MakeArgString(Name + ".hipfb");
353354
} else {
354-
auto TmpNameMcin = C.getDriver().GetTemporaryPath(Name, "mcin");
355+
auto TmpNameMcin = D.GetTemporaryPath(Name, "mcin");
355356
ObjinFile = C.addTempFile(C.getArgs().MakeArgString(TmpNameMcin));
356-
auto TmpNameFb = C.getDriver().GetTemporaryPath(Name, "hipfb");
357+
auto TmpNameFb = D.GetTemporaryPath(Name, "hipfb");
357358
BundleFile = C.addTempFile(C.getArgs().MakeArgString(TmpNameFb));
358359
}
359360
HIP::constructHIPFatbinCommand(C, JA, BundleFile, Inputs, Args, T);
@@ -456,7 +457,7 @@ void HIP::constructGenerateObjFileFromHIPFatBinary(
456457
llvm::raw_fd_ostream Objf(ObjinFile, EC, llvm::sys::fs::OF_None);
457458

458459
if (EC) {
459-
C.getDriver().Diag(clang::diag::err_unable_to_make_temp) << EC.message();
460+
D.Diag(clang::diag::err_unable_to_make_temp) << EC.message();
460461
return;
461462
}
462463

@@ -466,7 +467,7 @@ void HIP::constructGenerateObjFileFromHIPFatBinary(
466467
"-o", Output.getFilename(),
467468
"-x", "assembler",
468469
ObjinFile, "-c"};
469-
const char *Clang = Args.MakeArgString(C.getDriver().ClangExecutable);
470470
C.addCommand(std::make_unique<Command>(JA, T, ResponseFileSupport::None(),
471-
Clang, McArgs, Inputs, Output));
471+
D.getClangProgramPath(), McArgs,
472+
Inputs, Output, D.getPrependArg()));
472473
}

0 commit comments

Comments
 (0)