From 4cb3eeb832b5fb29a61f2934b3daa5e42a3d6cde Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 18 Jul 2023 08:08:11 -0700 Subject: Simplify Lookup and improve compiler performance. (#2996) * Simplify lookup. * Various bug fixes. * Report type dictionary size in perf benchmark. * Remove type duplication. * increase initial dict size. * Bug fix. * Fix bugs. * Fixup. * Revert type legalization looping. * Fix specialization pass. --------- Co-authored-by: Yong He --- source/slang/slang-check-constraint.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/slang/slang-check-constraint.cpp') diff --git a/source/slang/slang-check-constraint.cpp b/source/slang/slang-check-constraint.cpp index 2dc263115..22a92bf0a 100644 --- a/source/slang/slang-check-constraint.cpp +++ b/source/slang/slang-check-constraint.cpp @@ -457,7 +457,7 @@ namespace Slang // apply the substitutions we already know... GenericSubstitution* solvedSubst = m_astBuilder->getOrCreateGenericSubstitution( - genericDeclRef.getDecl(), args, genericDeclRef.getSubst()); + genericDeclRef.getSubst(), genericDeclRef.getDecl(), args.getArrayView()); for( auto constraintDecl : genericDeclRef.getDecl()->getMembersOfType() ) { @@ -510,7 +510,7 @@ namespace Slang } resultSubst = m_astBuilder->getOrCreateGenericSubstitution( - genericDeclRef.getDecl(), args, genericDeclRef.getSubst()); + genericDeclRef.getSubst(), genericDeclRef.getDecl(), args); return resultSubst; } @@ -633,7 +633,7 @@ namespace Slang auto fstGen = fst; auto sndGen = snd; // They must be specializing the same generic - if (fstGen->genericDecl != sndGen->genericDecl) + if (fstGen->getGenericDecl() != sndGen->getGenericDecl()) return false; // Their arguments must unify @@ -649,7 +649,7 @@ namespace Slang } // Their "base" specializations must unify - if (!tryUnifySubstitutions(constraints, fstGen->outer, sndGen->outer)) + if (!tryUnifySubstitutions(constraints, fstGen->getOuter(), sndGen->getOuter())) { okay = false; } -- cgit v1.2.3