================
@@ -164,6 +164,18 @@ class LLVM_LIBRARY_VISIBILITY BaseSPIRTargetInfo : public
TargetInfo {
UseExplicitBitFieldAlignment =
HostTarget->useExplicitBitFieldAlignment();
ZeroLengthBitfieldBoundary = HostTarget->getZeroLengthBitfieldBoundary();
+ // Copy pointer-related type representations from host so that
+ // sizeof(size_t), sizeof(ptrdiff_t), sizeof(intptr_t) match
+ // between host and device. Without this, LLP64 hosts (Windows)
+ // get incorrect LP64-style defaults.
+ SizeType = HostTarget->getSizeType();
+ PtrDiffType = HostTarget->getPtrDiffType(LangAS::Default);
+ IntPtrType = HostTarget->getIntPtrType();
+
+ // Inherit Microsoft C mangling if the host uses it.
+ if (HostTarget->shouldUseMicrosoftCCforMangling())
+ UseMicrosoftManglingForC = true;
----------------
tahonermann wrote:
I suggest we skip the Microsoft mangling related change for now since there are
currently no uses of it with the SPIR and SPIR-V targets. If/when we update the
Microsoft mangler to support SPIR/SPIR-V builtin types and generally enable its
use for device targets, we can add this back. In the meantime, I think adding
this now just invites controversy.
https://github.com/llvm/llvm-project/pull/208196
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits