diff options
| author | Yong He <yonghe@outlook.com> | 2022-09-05 00:38:45 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-05 00:38:45 -0700 |
| commit | ea0845285b0307d153a91d6f0a5010fc2d7219ed (patch) | |
| tree | bf2d8f7258b2681deddf3391c551c5ff2b1a7918 /source/slang/slang-ir-any-value-marshalling.cpp | |
| parent | 2a869c105dcc23ede8f5e6e16b08261f45aa5aad (diff) | |
Multi parameter `__subscript` (#2392)
* Multi parameter `__subscript`
* Fix.
* Fix bugs.
* Fix.
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-any-value-marshalling.cpp')
| -rw-r--r-- | source/slang/slang-ir-any-value-marshalling.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
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<uint32_t>(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; |
