[clang] [Clang] Add standalone AMDGPU SPIR-V toolchain (PR #144576)

Shilei Tian via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 18 21:19:01 PDT 2025


================
@@ -417,3 +417,15 @@ void HIPAMDToolChain::checkTargetID(
     getDriver().Diag(clang::diag::err_drv_bad_target_id)
         << *PTID.OptionalTargetID;
 }
+
+SPIRVAMDToolChain::SPIRVAMDToolChain(const Driver &D,
+                                     const llvm::Triple &Triple,
+                                     const ArgList &Args)
+    : ROCMToolChain(D, Triple, Args) {
+  getProgramPaths().push_back(getDriver().Dir);
+}
+
+Tool *SPIRVAMDToolChain::buildLinker() const {
+  assert(getTriple().getArch() == llvm::Triple::spirv64);
----------------
shiltian wrote:

assert will do nothing w/o assertion enabled. if it definitely shouldn't be creating the toolchain, probably do a llvm_unreachable?

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


More information about the cfe-commits mailing list