From f216b77752b9e4aea52882b2110ceb1cc64a2171 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 13 Sep 2022 13:11:48 -0700 Subject: Deduplicate AST type nodes and cache lookup operations. (#2397) * wip: dedup AST type nodes and cache lookup. * Fix. * Remove profiling. * Fixes. Co-authored-by: Yong He --- source/slang/slang.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index a0355c266..b68dbc14a 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -1178,7 +1178,7 @@ SLANG_NO_THROW slang::TypeReflection* SLANG_MCALL Linkage::getContainerType( ConstantBufferType* cbType = getASTBuilder()->create(); cbType->elementType = type; cbType->declRef = getASTBuilder()->getBuiltinDeclRef( - "ConstantBuffer", makeConstArrayViewSingle(static_cast(type))); + "ConstantBuffer", static_cast(type)); containerTypeReflection = cbType; } break; @@ -1187,7 +1187,7 @@ SLANG_NO_THROW slang::TypeReflection* SLANG_MCALL Linkage::getContainerType( ParameterBlockType* pbType = getASTBuilder()->create(); pbType->elementType = type; pbType->declRef = getASTBuilder()->getBuiltinDeclRef( - "ParameterBlock", makeConstArrayViewSingle(static_cast(type))); + "ParameterBlock", static_cast(type)); containerTypeReflection = pbType; } break; @@ -1197,7 +1197,7 @@ SLANG_NO_THROW slang::TypeReflection* SLANG_MCALL Linkage::getContainerType( getASTBuilder()->create(); sbType->elementType = type; sbType->declRef = getASTBuilder()->getBuiltinDeclRef( - "HLSLStructuredBufferType", makeConstArrayViewSingle(static_cast(type))); + "HLSLStructuredBufferType", static_cast(type)); containerTypeReflection = sbType; } break; @@ -3839,7 +3839,7 @@ struct SpecializationArgModuleCollector : ComponentTypeVisitor { if(auto genericSubst = as(substitution)) { - for(auto arg : genericSubst->args) + for(auto arg : genericSubst->getArgs()) { collectReferencedModules(arg); } -- cgit v1.2.3