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-emit-cpp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-emit-cpp.cpp') diff --git a/source/slang/slang-emit-cpp.cpp b/source/slang/slang-emit-cpp.cpp index 81bc2203a..ebe5965f4 100644 --- a/source/slang/slang-emit-cpp.cpp +++ b/source/slang/slang-emit-cpp.cpp @@ -403,8 +403,9 @@ void CPPSourceEmitter::useType(IRType* type) break; } case kIROp_RefType: + case kIROp_ConstRefType: { - type = static_cast(type)->getValueType(); + type = static_cast(type)->getValueType(); break; } default: break; @@ -1039,6 +1040,7 @@ void CPPSourceEmitter::_emitType(IRType* type, DeclaratorInfo* declarator) } break; case kIROp_RefType: + case kIROp_ConstRefType: { auto ptrType = cast(type); PtrDeclaratorInfo refDeclarator(declarator); -- cgit v1.2.3