From ea0845285b0307d153a91d6f0a5010fc2d7219ed Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 5 Sep 2022 00:38:45 -0700 Subject: Multi parameter `__subscript` (#2392) * Multi parameter `__subscript` * Fix. * Fix bugs. * Fix. Co-authored-by: Yong He --- source/slang/slang-ir-any-value-marshalling.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (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 39292e2b1..ea1a6cf32 100644 --- a/source/slang/slang-ir-any-value-marshalling.cpp +++ b/source/slang/slang-ir-any-value-marshalling.cpp @@ -86,18 +86,7 @@ namespace Slang virtual void marshalBasicType(IRBuilder* builder, IRType* dataType, IRInst* concreteTypedVar) = 0; // Defines what to do with resource handle elements. virtual void marshalResourceHandle(IRBuilder* builder, IRType* dataType, IRInst* concreteTypedVar) = 0; - // Validates that the type fits in the given AnyValueSize. - // After calling emitMarshallingCode, `fieldOffset` will be increased to the required `AnyValue` size. - // If this is larger than the provided AnyValue size, report a dianogstic. We might want to front load - // this in a separate IR validation pass in the future, but this is the easiest way to report the - // diagnostic now. - void validateAnyTypeSize(DiagnosticSink* sink, IRType* concreteType) - { - if (fieldOffset > static_cast(anyValInfo->fieldKeys.getCount())) - { - sink->diagnose(concreteType->sourceLoc, Diagnostics::typeDoesNotFitAnyValueSize, concreteType); - } - } + void ensureOffsetAt4ByteBoundary() { if (intraFieldOffset) @@ -396,8 +385,6 @@ namespace Slang context.anyValueVar = resultVar; emitMarshallingCode(&builder, &context, concreteTypedVar); - context.validateAnyTypeSize(sharedContext->sink, type); - auto load = builder.emitLoad(resultVar); builder.emitReturn(load); return func; -- cgit v1.2.3