[clang] Reland [HIP] use offload wrapper for non-device-only non-rdc (#132869) (PR #143964)
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 12 13:34:08 PDT 2025
================
@@ -9249,8 +9249,20 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA,
// Add the linker arguments to be forwarded by the wrapper.
CmdArgs.push_back(Args.MakeArgString(Twine("--linker-path=") +
LinkCommand->getExecutable()));
- for (const char *LinkArg : LinkCommand->getArguments())
- CmdArgs.push_back(LinkArg);
+
+ // We use action type to differentiate two use cases of the linker wrapper.
+ // TY_Image for normal linker wrapper work.
+ // TY_Object for HIP fno-gpu-rdc embedding device binary in a relocatable
+ // object.
+ assert(JA.getType() == types::TY_Object || JA.getType() == types::TY_Image);
----------------
jhuber6 wrote:
I'm wondering if we couldn't just make this a separate type of action. Like a relocatable linker wrapper thing. Can look into that in a follow up though.
https://github.com/llvm/llvm-project/pull/143964
More information about the cfe-commits
mailing list