From 73b52f6075eb8a4f674e5d66d2a6192ca71f26d3 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 21 Jul 2022 22:52:27 -0700 Subject: Allow dynamic dispatch to handle nested interface-typed fields. (#2336) --- source/slang/slang-ir-lower-generics.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'source/slang/slang-ir-lower-generics.cpp') diff --git a/source/slang/slang-ir-lower-generics.cpp b/source/slang/slang-ir-lower-generics.cpp index f517719ad..3b9a17738 100644 --- a/source/slang/slang-ir-lower-generics.cpp +++ b/source/slang/slang-ir-lower-generics.cpp @@ -5,6 +5,7 @@ #include "slang-ir-augment-make-existential.h" #include "slang-ir-generics-lowering-context.h" #include "slang-ir-lower-existential.h" +#include "slang-ir-lower-tuple-types.h" #include "slang-ir-lower-generic-function.h" #include "slang-ir-lower-generic-call.h" #include "slang-ir-lower-generic-type.h" @@ -194,15 +195,19 @@ namespace Slang if (sink->getErrorCount() != 0) return; - generateAnyValueMarshallingFunctions(&sharedContext); - if (sink->getErrorCount() != 0) - return; - // This optional step replaces all uses of witness tables and RTTI objects with // sequential IDs. Without this step, we will emit code that uses function pointers and // real RTTI objects and witness tables. specializeRTTIObjects(&sharedContext, sink); + lowerTuples(module, sink); + if (sink->getErrorCount() != 0) + return; + + generateAnyValueMarshallingFunctions(&sharedContext); + if (sink->getErrorCount() != 0) + return; + // We might have generated new temporary variables during lowering. // An SSA pass can clean up unnecessary load/stores. constructSSA(module); -- cgit v1.2.3