-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[HIP] Suport LLVM Driver #112249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HIP] Suport LLVM Driver #112249
Conversation
This addresses an issue introduced in llvm#112041.
@llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-driver Author: Petr Hosek (petrhosek) ChangesThis addresses an issue introduced in #112041. Full diff: https://github.com/llvm/llvm-project/pull/112249.diff 1 Files Affected:
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()));
}
|
C.addCommand(std::make_unique<Command>(JA, T, ResponseFileSupport::None(), | ||
Clang, McArgs, Inputs, Output)); | ||
D.getClangProgramPath(), McArgs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess we don't need to MakeArgString
because the lifetime of the Driver is for the whole compilation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is what we do in other parts of the driver as well.
Thanks for fixing this, didn't even know the |
This addresses an issue introduced in llvm#112041.
This addresses an issue introduced in #112041.