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-ast-type.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (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 9b6b439ce..ee5d1d40e 100644 --- a/source/slang/slang-ast-type.cpp +++ b/source/slang/slang-ast-type.cpp @@ -772,10 +772,8 @@ DeclRef ExtractExistentialType::getSpecializedInterfaceDeclRef() SubtypeWitness* openedWitness = getSubtypeWitness(); - ThisTypeSubstitution* openedThisType = m_astBuilder->create(); - openedThisType->outer = originalInterfaceDeclRef.getSubst(); - openedThisType->interfaceDecl = interfaceDecl; - openedThisType->witness = openedWitness; + ThisTypeSubstitution* openedThisType = m_astBuilder->getOrCreateThisTypeSubstitution( + interfaceDecl, openedWitness, originalInterfaceDeclRef.getSubst()); DeclRef specialiedInterfaceDeclRef = m_astBuilder->getSpecializedDeclRef(interfaceDecl, openedThisType); -- cgit v1.2.3