summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-constraint.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-07-05 14:37:48 -0700
committerGitHub <noreply@github.com>2023-07-05 14:37:48 -0700
commit6c7120d684cc46caafbe348d658158c0060a7638 (patch)
treee8ba738564b5cdceda22013900a0ed762c184bd3 /source/slang/slang-check-constraint.cpp
parent6063304cb8d73d430e7ef81c62cd9822302fcc19 (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-check-constraint.cpp')
-rw-r--r--source/slang/slang-check-constraint.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/slang/slang-check-constraint.cpp b/source/slang/slang-check-constraint.cpp
index f0df78c43..65d716db0 100644
--- a/source/slang/slang-check-constraint.cpp
+++ b/source/slang/slang-check-constraint.cpp
@@ -285,7 +285,7 @@ namespace Slang
// These seem more reasonable to have influence constraint solving, since it could
// conceivably let us specialize a `X<T> : IContainer` to `X<Int>` if we find
// that `X<T>.IndexType == T`.
- for( auto constraintDeclRef : getMembersOfType<GenericTypeConstraintDecl>(genericDeclRef) )
+ for( auto constraintDeclRef : getMembersOfType<GenericTypeConstraintDecl>(m_astBuilder, genericDeclRef) )
{
if(!TryUnifyTypes(*system, getSub(m_astBuilder, constraintDeclRef), getSup(m_astBuilder, constraintDeclRef)))
return SubstitutionSet();
@@ -323,7 +323,7 @@ namespace Slang
// and try to solve for each.
//
Count paramCounter = 0;
- for (auto m : getMembers(genericDeclRef))
+ for (auto m : getMembers(m_astBuilder, genericDeclRef))
{
if (auto typeParam = m.as<GenericTypeParamDecl>())
{
@@ -461,7 +461,7 @@ namespace Slang
for( auto constraintDecl : genericDeclRef.getDecl()->getMembersOfType<GenericTypeConstraintDecl>() )
{
- DeclRef<GenericTypeConstraintDecl> constraintDeclRef(
+ DeclRef<GenericTypeConstraintDecl> constraintDeclRef = m_astBuilder->getSpecializedDeclRef(
constraintDecl,
solvedSubst);