From a6032446c6bf7f64d1e201bf438a4c7605a3dbb4 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 15 Sep 2022 14:22:59 -0700 Subject: Language feature: pointer sized int types. (#2401) * Language feature: pointer sized int types. * Fix. * small change to test. * Fix stdlib. * Fix. * Fix. * Add typedef for `size_t` in stdlib. * Fix test. * Add `intptr_t::size` constant. Co-authored-by: Yong He --- source/slang/slang-ir-any-value-marshalling.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/slang/slang-ir-any-value-marshalling.cpp') diff --git a/source/slang/slang-ir-any-value-marshalling.cpp b/source/slang/slang-ir-any-value-marshalling.cpp index f1a1982c2..446d8faf0 100644 --- a/source/slang/slang-ir-any-value-marshalling.cpp +++ b/source/slang/slang-ir-any-value-marshalling.cpp @@ -136,6 +136,8 @@ namespace Slang case kIROp_UInt16Type: case kIROp_HalfType: case kIROp_BoolType: + case kIROp_IntPtrType: + case kIROp_UIntPtrType: context->marshalBasicType(builder, dataType, concreteTypedVar); break; case kIROp_VectorType: @@ -239,6 +241,9 @@ namespace Slang case kIROp_IntType: case kIROp_FloatType: case kIROp_BoolType: +#if SLANG_PTR_IS_32 + case kIROp_IntPtrType: +#endif { ensureOffsetAt4ByteBoundary(); if (fieldOffset < static_cast(anyValInfo->fieldKeys.getCount())) @@ -255,6 +260,9 @@ namespace Slang break; } case kIROp_UIntType: +#if SLANG_PTR_IS_32 + case kIROp_UIntPtrType: +#endif { ensureOffsetAt4ByteBoundary(); if (fieldOffset < static_cast(anyValInfo->fieldKeys.getCount())) @@ -313,6 +321,10 @@ namespace Slang case kIROp_UInt64Type: case kIROp_Int64Type: case kIROp_DoubleType: +#if SLANG_PTR_IS_64 + case kIROp_UIntPtrType: + case kIROp_IntPtrType: +#endif SLANG_UNIMPLEMENTED_X("AnyValue type packing for non 32-bit elements"); break; default: -- cgit v1.2.3