From 004f6e30b5df3a3df2c26fe5c4a5e78c49f71166 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 9 Nov 2022 19:19:17 -0800 Subject: Add `[ForwardDerivativeOf]` attribute. (#2501) * Add [ForwardDerivativeOf] attribute. * Fix handling around phi nodes. * Fixes. * Remove IR opcode for ForwardDerivativeOfDecoration. Co-authored-by: Yong He --- source/slang/slang-ast-type.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/slang/slang-ast-type.cpp') diff --git a/source/slang/slang-ast-type.cpp b/source/slang/slang-ast-type.cpp index a869c95a7..ba033c3ad 100644 --- a/source/slang/slang-ast-type.cpp +++ b/source/slang/slang-ast-type.cpp @@ -473,6 +473,11 @@ Type* NamespaceType::_createCanonicalTypeOverride() return this; } +Type* DifferentialPairType::getPrimalType() +{ + return as(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[0]); +} + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! PtrTypeBase !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -- cgit v1.2.3