@@ -340,20 +340,21 @@ void HIP::constructHIPFatbinCommand(Compilation &C, const JobAction &JA,
340
340
void HIP::constructGenerateObjFileFromHIPFatBinary (
341
341
Compilation &C, const InputInfo &Output, const InputInfoList &Inputs,
342
342
const ArgList &Args, const JobAction &JA, const Tool &T) {
343
+ const Driver &D = C.getDriver ();
343
344
std::string Name = std::string (llvm::sys::path::stem (Output.getFilename ()));
344
345
345
346
// Create Temp Object File Generator,
346
347
// Offload Bundled file and Bundled Object file.
347
348
// Keep them if save-temps is enabled.
348
349
const char *ObjinFile;
349
350
const char *BundleFile;
350
- if (C. getDriver () .isSaveTempsEnabled ()) {
351
+ if (D .isSaveTempsEnabled ()) {
351
352
ObjinFile = C.getArgs ().MakeArgString (Name + " .mcin" );
352
353
BundleFile = C.getArgs ().MakeArgString (Name + " .hipfb" );
353
354
} else {
354
- auto TmpNameMcin = C. getDriver () .GetTemporaryPath (Name, " mcin" );
355
+ auto TmpNameMcin = D .GetTemporaryPath (Name, " mcin" );
355
356
ObjinFile = C.addTempFile (C.getArgs ().MakeArgString (TmpNameMcin));
356
- auto TmpNameFb = C. getDriver () .GetTemporaryPath (Name, " hipfb" );
357
+ auto TmpNameFb = D .GetTemporaryPath (Name, " hipfb" );
357
358
BundleFile = C.addTempFile (C.getArgs ().MakeArgString (TmpNameFb));
358
359
}
359
360
HIP::constructHIPFatbinCommand (C, JA, BundleFile, Inputs, Args, T);
@@ -456,7 +457,7 @@ void HIP::constructGenerateObjFileFromHIPFatBinary(
456
457
llvm::raw_fd_ostream Objf (ObjinFile, EC, llvm::sys::fs::OF_None);
457
458
458
459
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 ();
460
461
return ;
461
462
}
462
463
@@ -466,7 +467,7 @@ void HIP::constructGenerateObjFileFromHIPFatBinary(
466
467
" -o" , Output.getFilename (),
467
468
" -x" , " assembler" ,
468
469
ObjinFile, " -c" };
469
- const char *Clang = Args.MakeArgString (C.getDriver ().ClangExecutable );
470
470
C.addCommand (std::make_unique<Command>(JA, T, ResponseFileSupport::None (),
471
- Clang, McArgs, Inputs, Output));
471
+ D.getClangProgramPath (), McArgs,
472
+ Inputs, Output, D.getPrependArg ()));
472
473
}
0 commit comments