summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-modifier.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-03-07 11:22:32 -0800
committerGitHub <noreply@github.com>2023-03-07 11:22:32 -0800
commit257733f328f38a763c8b0c8830ff4c0d34ec9491 (patch)
tree87e444746f353d69a365380904f3f8caf15fbfec /source/slang/slang-check-modifier.cpp
parent6f31eae79d5b4297d0099c5779a9806a786cf9f8 (diff)
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 <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-check-modifier.cpp')
-rw-r--r--source/slang/slang-check-modifier.cpp11
1 files changed, 1 insertions, 10 deletions
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<Decl>(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<Decl>(attrTarget));
- return false;
- }
- derivativeOfAttr->funcExpr = primalFunc;
+ derivativeOfAttr->funcExpr = attr->args[0];
}
else if (auto comInterfaceAttr = as<ComInterfaceAttribute>(attr))
{