[llvm-branch-commits] [clang] clang/AMDGPU: Merge toolchain subclasses (PR #204863)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jun 22 07:25:43 PDT 2026


================
@@ -672,20 +673,34 @@ void amdgpu::getAMDGPUTargetFeatures(const Driver &D,
 
 /// AMDGPU Toolchain
 AMDGPUToolChain::AMDGPUToolChain(const Driver &D, const llvm::Triple &Triple,
-                                 const ArgList &Args)
+                                 const ArgList &Args, const ToolChain *HostTC_,
+                                 Action::OffloadKind Kind,
+                                 bool ShouldLinkDeviceLibs_)
     : Generic_ELF(D, Triple, Args),
       OptionsDefault(
-          {{options::OPT_O, "3"}, {options::OPT_cl_std_EQ, "CL1.2"}}) {
+          {{options::OPT_O, "3"}, {options::OPT_cl_std_EQ, "CL1.2"}}),
+      HostTC(HostTC_), UseHIPLinker(Kind == Action::OFK_HIP),
+      ShouldLinkDeviceLibs(ShouldLinkDeviceLibs_) {
   loadMultilibsFromYAML(Args, D);
 
   // Check code object version options. Emit warnings for legacy options
   // and errors for the last invalid code object version options.
   // It is done here to avoid repeated warning or error messages for
   // each tool invocation.
   checkAMDGPUCodeObjectVersion(D, Args);
+
+  if (Triple.getOS() == llvm::Triple::AMDHSA &&
----------------
arsenm wrote:

That was already the behavior. The only case where you don't error today is the degenerate case of targeting regular c, which this maintains

https://github.com/llvm/llvm-project/pull/204863


More information about the llvm-branch-commits mailing list