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-ir-util.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/slang/slang-ir-util.cpp') diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp index 62da8cffd..b4a41f8a5 100644 --- a/source/slang/slang-ir-util.cpp +++ b/source/slang/slang-ir-util.cpp @@ -418,6 +418,7 @@ bool isPtrLikeOrHandleType(IRInst* type) case kIROp_InOutType: case kIROp_PtrType: case kIROp_RefType: + case kIROp_ConstRefType: return true; } return false; @@ -970,6 +971,17 @@ bool isOne(IRInst* inst) } } +IRPtrTypeBase* isMutablePointerType(IRInst* inst) +{ + switch (inst->getOp()) + { + case kIROp_ConstRefType: + return nullptr; + default: + return as(inst); + } +} + void initializeScratchData(IRInst* inst) { List workList; -- cgit v1.2.3