From 6c7120d684cc46caafbe348d658158c0060a7638 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 5 Jul 2023 14:37:48 -0700 Subject: Bottleneck DeclRef creation through ASTBuilder. (#2689) * Bottleneck DeclRef creation through ASTBuilder. * Fix clang error. * Fix. * Fix. * More fix. * Rebase on top of tree. --------- Co-authored-by: Yong He --- source/slang/slang-syntax.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/slang/slang-syntax.cpp') diff --git a/source/slang/slang-syntax.cpp b/source/slang/slang-syntax.cpp index 53e77e646..09329689e 100644 --- a/source/slang/slang-syntax.cpp +++ b/source/slang/slang-syntax.cpp @@ -723,7 +723,7 @@ Index getFilterCountImpl(const ReflectClassInfo& clsInfo, MemberFilterStyle filt int diff = 0; auto declRefBase = declRef.substituteImpl(astBuilder, substs, &diff); - return DeclRef(declRefBase.decl, declRefBase.substitutions); + return astBuilder->getSpecializedDeclRef(declRefBase.decl, declRefBase.substitutions); } Type* substituteType(SubstitutionSet const& substs, ASTBuilder* astBuilder, Type* type) @@ -1006,7 +1006,7 @@ Index getFilterCountImpl(const ReflectClassInfo& clsInfo, MemberFilterStyle filt return decl->loc; } - DeclRefBase DeclRefBase::getParent() const + DeclRefBase DeclRefBase::getParent(ASTBuilder* astBuilder) const { // Want access to the free function (the 'as' method by default gets priority) // Can access as method with this->as because it removes any ambiguity. @@ -1054,7 +1054,7 @@ Index getFilterCountImpl(const ReflectClassInfo& clsInfo, MemberFilterStyle filt } } - return DeclRefBase(parentDecl, substToApply); + return astBuilder->getSpecializedDeclRef(parentDecl, substToApply); } HashCode DeclRefBase::getHashCode() const @@ -1138,7 +1138,7 @@ Index getFilterCountImpl(const ReflectClassInfo& clsInfo, MemberFilterStyle filt funcType->resultType = getResultType(astBuilder, declRef); funcType->errorType = getErrorCodeType(astBuilder, declRef); - for (auto paramDeclRef : getParameters(declRef)) + for (auto paramDeclRef : getParameters(astBuilder, declRef)) { auto paramDecl = paramDeclRef.getDecl(); auto paramType = getParamType(astBuilder, paramDeclRef); -- cgit v1.2.3