From a083a37ee58dc48d92cf2b844466a295eb3e643e Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 10 Aug 2022 15:37:19 -0700 Subject: Add `none` literal that is convertible to `Optional`. (#2356) * Add `none` literal that is convertible to `Optional`. * Fix cpu code gen. * Include vk and cpu test for is-as operator test. * Inline comparison operators. Co-authored-by: Yong He --- source/slang/slang-lower-to-ir.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/slang/slang-lower-to-ir.cpp') diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index aef60c9d9..c7fbfda77 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -3365,6 +3365,11 @@ struct ExprLoweringVisitorBase : ExprVisitor return LoweredValInfo::simple(context->irBuilder->getPtrValue(nullptr)); } + LoweredValInfo visitNoneLiteralExpr(NoneLiteralExpr*) + { + return LoweredValInfo::simple(context->irBuilder->getVoidValue()); + } + LoweredValInfo visitIntegerLiteralExpr(IntegerLiteralExpr* expr) { auto type = lowerType(context, expr->type); -- cgit v1.2.3