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-check-shader.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-check-shader.cpp')
| -rw-r--r-- | source/slang/slang-check-shader.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/slang/slang-check-shader.cpp b/source/slang/slang-check-shader.cpp index ed426831c..acefa7660 100644 --- a/source/slang/slang-check-shader.cpp +++ b/source/slang/slang-check-shader.cpp @@ -101,7 +101,7 @@ namespace Slang // A structure type should recursively introduce // existential slots for its fields. // - for( auto fieldDeclRef : getFields(structDeclRef, MemberFilterStyle::Instance) ) + for( auto fieldDeclRef : getFields(astBuilder, structDeclRef, MemberFilterStyle::Instance) ) { _collectExistentialSpecializationParamsRec( astBuilder, @@ -206,7 +206,7 @@ namespace Slang // if( auto funcDeclRef = getFuncDeclRef() ) { - for( auto paramDeclRef : getParameters(funcDeclRef) ) + for( auto paramDeclRef : getParameters(getLinkage()->getASTBuilder(), funcDeclRef) ) { ShaderParamInfo shaderParamInfo; shaderParamInfo.paramDeclRef = paramDeclRef; @@ -1059,7 +1059,7 @@ namespace Slang for(auto constraintDecl : genericTypeParamDecl->getMembersOfType<GenericTypeConstraintDecl>()) { // Get the type that the constraint is enforcing conformance to - auto interfaceType = getSup(getLinkage()->getASTBuilder(), DeclRef<GenericTypeConstraintDecl>(constraintDecl, nullptr)); + auto interfaceType = getSup(getLinkage()->getASTBuilder(), DeclRef<GenericTypeConstraintDecl>(constraintDecl)); // Use our semantic-checking logic to search for a witness to the required conformance auto witness = visitor.tryGetSubtypeWitness(argType, interfaceType); @@ -1193,7 +1193,7 @@ namespace Slang // the semantic checking machinery to expand out // the rest of the arguments via inference... - auto genericDeclRef = m_funcDeclRef.getParent().as<GenericDecl>(); + auto genericDeclRef = m_funcDeclRef.getParent(getLinkage()->getASTBuilder()).as<GenericDecl>(); SLANG_ASSERT(genericDeclRef); // otherwise we wouldn't have generic parameters List<Val*> genericArgs; @@ -1214,7 +1214,7 @@ namespace Slang auto constraintSubst = genericDeclRef.substitutions; constraintSubst.substitutions = genericSubst; - DeclRef<GenericTypeConstraintDecl> constraintDeclRef( + DeclRef<GenericTypeConstraintDecl> constraintDeclRef = getLinkage()->getASTBuilder()->getSpecializedDeclRef( constraintDecl, constraintSubst); ASTBuilder* astBuilder = getLinkage()->getASTBuilder(); |
