From b7d318f48db2cb83a41d665f1727ae93fc555124 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 28 Sep 2023 18:07:40 -0700 Subject: Support `constref` parameters passing. (#3249) * Support `constref` parameters passing. * Fix. * Fix. * Add test and diagnostic on mix use of __constref and no_diff. * check for [constref] on differentiable member method. --------- Co-authored-by: Yong He --- source/slang/slang-ast-builder.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/slang/slang-ast-builder.cpp') diff --git a/source/slang/slang-ast-builder.cpp b/source/slang/slang-ast-builder.cpp index b2d1e5c09..6a9aad257 100644 --- a/source/slang/slang-ast-builder.cpp +++ b/source/slang/slang-ast-builder.cpp @@ -311,6 +311,11 @@ RefType* ASTBuilder::getRefType(Type* valueType) return dynamicCast(getPtrType(valueType, "RefType")); } +ConstRefType* ASTBuilder::getConstRefType(Type* valueType) +{ + return dynamicCast(getPtrType(valueType, "ConstRefType")); +} + OptionalType* ASTBuilder::getOptionalType(Type* valueType) { auto rsType = getSpecializedBuiltinType(valueType, "OptionalType"); -- cgit v1.2.3