diff options
| author | Yong He <yonghe@outlook.com> | 2023-07-05 14:37:48 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-05 14:37:48 -0700 |
| commit | 6c7120d684cc46caafbe348d658158c0060a7638 (patch) | |
| tree | e8ba738564b5cdceda22013900a0ed762c184bd3 /source/slang/slang-syntax.cpp | |
| parent | 6063304cb8d73d430e7ef81c62cd9822302fcc19 (diff) | |
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 <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-syntax.cpp')
| -rw-r--r-- | source/slang/slang-syntax.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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<Decl>(declRefBase.decl, declRefBase.substitutions); + return astBuilder->getSpecializedDeclRef<Decl>(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); |
