summaryrefslogtreecommitdiff
path: root/source/slang/slang-ast-type.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-09-13 13:11:48 -0700
committerGitHub <noreply@github.com>2022-09-13 13:11:48 -0700
commitf216b77752b9e4aea52882b2110ceb1cc64a2171 (patch)
treefbb33485b7260bc0f89b406e1be6fb8196f94196 /source/slang/slang-ast-type.cpp
parent9f3e83cf0d664c87a618edf08d834829178030e6 (diff)
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 <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ast-type.cpp')
-rw-r--r--source/slang/slang-ast-type.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/slang/slang-ast-type.cpp b/source/slang/slang-ast-type.cpp
index a84f04a32..077d6de0a 100644
--- a/source/slang/slang-ast-type.cpp
+++ b/source/slang/slang-ast-type.cpp
@@ -224,7 +224,7 @@ Val* DeclRefType::_substituteImplOverride(ASTBuilder* astBuilder, SubstitutionSe
{
// We've found it, so return the corresponding specialization argument
(*ioDiff)++;
- return genericSubst->args[index];
+ return genericSubst->getArgs()[index];
}
else if (auto typeParam = as<GenericTypeParamDecl>(m))
{
@@ -351,17 +351,17 @@ BasicExpressionType* MatrixExpressionType::_getScalarTypeOverride()
Type* MatrixExpressionType::getElementType()
{
- return as<Type>(findInnerMostGenericSubstitution(declRef.substitutions)->args[0]);
+ return as<Type>(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[0]);
}
IntVal* MatrixExpressionType::getRowCount()
{
- return as<IntVal>(findInnerMostGenericSubstitution(declRef.substitutions)->args[1]);
+ return as<IntVal>(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[1]);
}
IntVal* MatrixExpressionType::getColumnCount()
{
- return as<IntVal>(findInnerMostGenericSubstitution(declRef.substitutions)->args[2]);
+ return as<IntVal>(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[2]);
}
Type* MatrixExpressionType::getRowType()
@@ -518,12 +518,12 @@ Type* NamespaceType::_createCanonicalTypeOverride()
Type* PtrTypeBase::getValueType()
{
- return as<Type>(findInnerMostGenericSubstitution(declRef.substitutions)->args[0]);
+ return as<Type>(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[0]);
}
Type* OptionalType::getValueType()
{
- return as<Type>(findInnerMostGenericSubstitution(declRef.substitutions)->args[0]);
+ return as<Type>(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[0]);
}
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! NamedExpressionType !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!