================
@@ -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
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to