[clang] [SYCL][SPIR-V][Windows] Extend BaseSPIRTargetInfo host-adaptation for Windows support (PR #208196)

Tom Honermann via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 18 09:26:27 PDT 2026


================
@@ -272,8 +284,10 @@ class LLVM_LIBRARY_VISIBILITY SPIR32TargetInfo : public SPIRTargetInfo {
     assert(Triple.getArch() == llvm::Triple::spir &&
            "Invalid architecture for 32-bit SPIR.");
     PointerWidth = PointerAlign = 32;
-    SizeType = TargetInfo::UnsignedInt;
-    PtrDiffType = IntPtrType = TargetInfo::SignedInt;
+    if (!HostTarget || HostTarget->getPointerWidth(LangAS::Default) != 32) {
+      SizeType = TargetInfo::UnsignedInt;
+      PtrDiffType = IntPtrType = TargetInfo::SignedInt;
+    }
----------------
tahonermann wrote:

One of the goals of my suggestion is to ensure that we treat use of a 64-bit host with the 32-bit SPIR-V target as an error. We shouldn’t silently correct for that; hence the suggested unconditional asserts (and conditional assignments for when no host target is specified). 

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


More information about the cfe-commits mailing list