From 812e478989e27983b8dea7ab11964de751654ba2 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 4 Jun 2025 13:05:58 -0700 Subject: Make interface types non c-style in Slang2026. (#7260) * Make interface types non c-style. * Make Optional work with autodiff and existential types. * Fix. * patch behind slang 2026. * Fix warnings. * cleanup. * Fix tests. * Fix. * Fix com interface lowering. * Add comment to test. * regenerate command line reference * Add test for passing `none` to autodiff function. * Fix recording of `getDynamicObjectRTTIBytes`. * Fix nested Optional types. --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --- source/slang/slang-ir.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index f571ec20b..e66ad69ce 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -3515,6 +3515,14 @@ IRInst* IRBuilder::emitExtractExistentialValue(IRType* type, IRInst* existential return inst; } +IRInst* IRBuilder::emitIsNullExistential(IRInst* existentialValue) +{ + auto inst = + createInst(this, kIROp_IsNullExistential, getBoolType(), 1, &existentialValue); + addInst(inst); + return inst; +} + IRType* IRBuilder::emitExtractExistentialType(IRInst* existentialValue) { auto type = getTypeKind(); @@ -8648,6 +8656,7 @@ bool IRInst::mightHaveSideEffects(SideEffectAnalysisOptions options) case kIROp_ExtractExistentialType: case kIROp_ExtractExistentialValue: case kIROp_ExtractExistentialWitnessTable: + case kIROp_IsNullExistential: case kIROp_WrapExistential: case kIROp_BuiltinCast: case kIROp_BitCast: -- cgit v1.2.3