From b820f34a1b6336af184458c5b1dfe2273c99f1ff Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 18 Aug 2020 13:08:45 -0700 Subject: Support initializing an existential value from a generic value. (#1503) * Support initializing an existential value from a generic value. * Remove trailing spaces and clean up debugging code. --- source/slang/slang-ir.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index 2a1db6310..c5943da3c 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -2790,6 +2790,16 @@ namespace Slang return emitIntrinsicInst(type, kIROp_MakeExistential, SLANG_COUNT_OF(args), args); } + IRInst* IRBuilder::emitMakeExistentialWithRTTI( + IRType* type, + IRInst* value, + IRInst* witnessTable, + IRInst* rtti) + { + IRInst* args[] = { value, witnessTable, rtti }; + return emitIntrinsicInst(type, kIROp_MakeExistentialWithRTTI, SLANG_COUNT_OF(args), args); + } + IRInst* IRBuilder::emitWrapExistential( IRType* type, IRInst* value, -- cgit v1.2.3