diff options
| author | Yong He <yonghe@outlook.com> | 2023-07-07 14:26:37 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-07 14:26:37 -0700 |
| commit | 643aaa13d2c6e0c4994437aa9fba6716787608ce (patch) | |
| tree | 279794cfafecc89f0be133d2a81750d59d9ee94a /source/slang/slang-lookup.cpp | |
| parent | fb6605c2a7bc17d3b3b79dabd07e1f05267eb33a (diff) | |
Make DeclRefBase a Val, and DeclRef<T> a helper class. (#2967)
* Make DeclRefBase a Val, and DeclRef<T> a helper class.
* Fixes.
* Workaround gcc parser issue.
* Revert NodeOperand change.
* Fix.
* Fix clang incomplete class complains.
* Fix code review.
* Small cleanups and improvements.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-lookup.cpp')
| -rw-r--r-- | source/slang/slang-lookup.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/slang/slang-lookup.cpp b/source/slang/slang-lookup.cpp index 46977b71d..b16671efb 100644 --- a/source/slang/slang-lookup.cpp +++ b/source/slang/slang-lookup.cpp @@ -176,7 +176,7 @@ static void _lookUpDirectAndTransparentMembers( AddToLookupResult( result, CreateLookupResultItem( - astBuilder->getSpecializedDeclRef<Decl>(member, containerDeclRef.substitutions), inBreadcrumbs)); + astBuilder->getSpecializedDeclRef<Decl>(member, containerDeclRef.getSubst()), inBreadcrumbs)); } } else @@ -201,7 +201,7 @@ static void _lookUpDirectAndTransparentMembers( continue; // The declaration passed the test, so add it! - AddToLookupResult(result, CreateLookupResultItem(astBuilder->getSpecializedDeclRef<Decl>(m, containerDeclRef.substitutions), inBreadcrumbs)); + AddToLookupResult(result, CreateLookupResultItem(astBuilder->getSpecializedDeclRef<Decl>(m, containerDeclRef.getSubst()), inBreadcrumbs)); } } @@ -211,7 +211,7 @@ static void _lookUpDirectAndTransparentMembers( { // The reference to the transparent member should use whatever // substitutions we used in referring to its outer container - DeclRef<Decl> transparentMemberDeclRef = astBuilder->getSpecializedDeclRef(transparentInfo.decl, containerDeclRef.substitutions); + DeclRef<Decl> transparentMemberDeclRef = astBuilder->getSpecializedDeclRef(transparentInfo.decl, containerDeclRef.getSubst()); // We need to leave a breadcrumb so that we know that the result // of lookup involves a member lookup step here @@ -320,7 +320,7 @@ static Type* _maybeSpecializeSuperType( ThisTypeSubstitution* thisTypeSubst = astBuilder->create<ThisTypeSubstitution>(); thisTypeSubst->interfaceDecl = superInterfaceDeclRef.getDecl(); thisTypeSubst->witness = subIsSuperWitness; - thisTypeSubst->outer = superInterfaceDeclRef.substitutions.substitutions; + thisTypeSubst->outer = superInterfaceDeclRef.getSubst(); auto specializedInterfaceDeclRef = astBuilder->getSpecializedDeclRef<Decl>(superInterfaceDeclRef.getDecl(), thisTypeSubst); @@ -403,7 +403,7 @@ static void _lookUpMembersInSuperType( { if( request.semantics ) { - ensureDecl(request.semantics, intermediateIsSuperConstraint, DeclCheckState::CanUseBaseOfInheritanceDecl); + ensureDecl(request.semantics, intermediateIsSuperConstraint.getDecl(), DeclCheckState::CanUseBaseOfInheritanceDecl); } // The super-type in the constraint (e.g., `Foo` in `T : Foo`) @@ -450,11 +450,11 @@ static void _lookUpMembersInSuperTypeDeclImpl( auto genericDeclRef = genericTypeParamDeclRef.getParent(astBuilder).as<GenericDecl>(); assert(genericDeclRef); - for(auto constraintDeclRef : getMembersOfType<GenericTypeConstraintDecl>(astBuilder, genericDeclRef)) + for(auto constraintDeclRef : getMembersOfType<GenericTypeConstraintDecl>(astBuilder, DeclRef<ContainerDecl>(genericDeclRef))) { if( semantics ) { - ensureDecl(semantics, constraintDeclRef, DeclCheckState::CanUseBaseOfInheritanceDecl); + ensureDecl(semantics, constraintDeclRef.getDecl(), DeclCheckState::CanUseBaseOfInheritanceDecl); } // Does this constraint pertain to the type we are working on? |
