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-check-shader.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/slang/slang-check-shader.cpp') 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()) { // Get the type that the constraint is enforcing conformance to - auto interfaceType = getSup(getLinkage()->getASTBuilder(), DeclRef(constraintDecl, nullptr)); + auto interfaceType = getSup(getLinkage()->getASTBuilder(), DeclRef(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(); + auto genericDeclRef = m_funcDeclRef.getParent(getLinkage()->getASTBuilder()).as(); SLANG_ASSERT(genericDeclRef); // otherwise we wouldn't have generic parameters List genericArgs; @@ -1214,7 +1214,7 @@ namespace Slang auto constraintSubst = genericDeclRef.substitutions; constraintSubst.substitutions = genericSubst; - DeclRef constraintDeclRef( + DeclRef constraintDeclRef = getLinkage()->getASTBuilder()->getSpecializedDeclRef( constraintDecl, constraintSubst); ASTBuilder* astBuilder = getLinkage()->getASTBuilder(); -- cgit v1.2.3