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-val.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/slang/slang-ast-val.cpp') diff --git a/source/slang/slang-ast-val.cpp b/source/slang/slang-ast-val.cpp index 37912bac2..b45300af8 100644 --- a/source/slang/slang-ast-val.cpp +++ b/source/slang/slang-ast-val.cpp @@ -118,7 +118,7 @@ HashCode GenericParamIntVal::_getHashCodeOverride() Val* maybeSubstituteGenericParam(Val* paramVal, Decl* paramDecl, SubstitutionSet subst, int* ioDiff) { // search for a substitution that might apply to us - for (auto s = subst.substitutions; s; s = s->outer) + for (auto s = subst.substitutions; s; s = s->getOuter()) { auto genSubst = as(s); if (!genSubst) @@ -126,7 +126,7 @@ Val* maybeSubstituteGenericParam(Val* paramVal, Decl* paramDecl, SubstitutionSet // the generic decl associated with the substitution list must be // the generic decl that declared this parameter - auto genericDecl = genSubst->genericDecl; + auto genericDecl = genSubst->getGenericDecl(); if (genericDecl != paramDecl->parentDecl) continue; @@ -261,13 +261,13 @@ Val* DeclaredSubtypeWitness::_substituteImplOverride(ASTBuilder* astBuilder, Sub auto genConstraintDecl = genConstraintDeclRef.getDecl(); // search for a substitution that might apply to us - for (auto s = subst.substitutions; s; s = s->outer) + for (auto s = subst.substitutions; s; s = s->getOuter()) { if (auto genericSubst = as(s)) { // the generic decl associated with the substitution list must be // the generic decl that declared this parameter - auto genericDecl = genericSubst->genericDecl; + auto genericDecl = genericSubst->getGenericDecl(); if (genericDecl != genConstraintDecl->parentDecl) continue; -- cgit v1.2.3