From 257733f328f38a763c8b0c8830ff4c0d34ec9491 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 7 Mar 2023 11:22:32 -0800 Subject: Reuse higher-order `ResolveInvoke` logic to resolve func refs in `[*DerivativeOf]` attribs. (#2688) * Reuse higher-order `ResolveInvoke` logic to resolve func refs in [*DerivativeOf] attribs. * Add diff implementation matrix versions of binary and ternary intrinsics. * Add diff impl for legacy intrinsics. * Fix diagnostics of using non-differentiable function in a diff operator. * Add diff implementation for `determinant`. --------- Co-authored-by: Yong He --- source/slang/slang-check-modifier.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'source/slang/slang-check-modifier.cpp') diff --git a/source/slang/slang-check-modifier.cpp b/source/slang/slang-check-modifier.cpp index 520d85971..e6a524645 100644 --- a/source/slang/slang-check-modifier.cpp +++ b/source/slang/slang-check-modifier.cpp @@ -680,16 +680,7 @@ namespace Slang { SLANG_ASSERT(attr->args.getCount() == 1); SLANG_ASSERT(as(attrTarget)); - - // Ensure that the argument is a reference to a function definition or declaration. - auto primalFunc = CheckTerm(attr->args[0]); - if (primalFunc->type == getASTBuilder()->getErrorType()) - { - // Could not resolve the term. - getSink()->diagnose(primalFunc, Slang::Diagnostics::invalidCustomDerivative, as(attrTarget)); - return false; - } - derivativeOfAttr->funcExpr = primalFunc; + derivativeOfAttr->funcExpr = attr->args[0]; } else if (auto comInterfaceAttr = as(attr)) { -- cgit v1.2.3