From 643aaa13d2c6e0c4994437aa9fba6716787608ce Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 7 Jul 2023 14:26:37 -0700 Subject: Make DeclRefBase a Val, and DeclRef a helper class. (#2967) * Make DeclRefBase a Val, and DeclRef 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 --- source/slang/slang-ast-type.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'source/slang/slang-ast-type.cpp') diff --git a/source/slang/slang-ast-type.cpp b/source/slang/slang-ast-type.cpp index c4d301852..b24e0eb8e 100644 --- a/source/slang/slang-ast-type.cpp +++ b/source/slang/slang-ast-type.cpp @@ -274,7 +274,7 @@ BasicExpressionType* BasicExpressionType::_getScalarTypeOverride() // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! TensorViewType !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Type* TensorViewType::getElementType() { - return as(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[0]); + return as(findInnerMostGenericSubstitution(declRef.getSubst())->getArgs()[0]); } @@ -304,17 +304,17 @@ BasicExpressionType* MatrixExpressionType::_getScalarTypeOverride() Type* MatrixExpressionType::getElementType() { - return as(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[0]); + return as(findInnerMostGenericSubstitution(declRef.getSubst())->getArgs()[0]); } IntVal* MatrixExpressionType::getRowCount() { - return as(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[1]); + return as(findInnerMostGenericSubstitution(declRef.getSubst())->getArgs()[1]); } IntVal* MatrixExpressionType::getColumnCount() { - return as(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[2]); + return as(findInnerMostGenericSubstitution(declRef.getSubst())->getArgs()[2]); } Type* MatrixExpressionType::getRowType() @@ -330,12 +330,12 @@ Type* MatrixExpressionType::getRowType() Type* ArrayExpressionType::getElementType() { - return as(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[0]); + return as(findInnerMostGenericSubstitution(declRef.getSubst())->getArgs()[0]); } IntVal* ArrayExpressionType::getElementCount() { - return as(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[1]); + return as(findInnerMostGenericSubstitution(declRef.getSubst())->getArgs()[1]); } void ArrayExpressionType::_toTextOverride(StringBuilder& out) @@ -441,7 +441,7 @@ Type* NamespaceType::_createCanonicalTypeOverride() Type* DifferentialPairType::getPrimalType() { - return as(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[0]); + return as(findInnerMostGenericSubstitution(declRef.getSubst())->getArgs()[0]); } @@ -449,12 +449,12 @@ Type* DifferentialPairType::getPrimalType() Type* PtrTypeBase::getValueType() { - return as(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[0]); + return as(findInnerMostGenericSubstitution(declRef.getSubst())->getArgs()[0]); } Type* OptionalType::getValueType() { - return as(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[0]); + return as(findInnerMostGenericSubstitution(declRef.getSubst())->getArgs()[0]); } // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! NamedExpressionType !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -463,7 +463,7 @@ void NamedExpressionType::_toTextOverride(StringBuilder& out) { if (declRef.getDecl()) { - _printNestedDecl(declRef.substitutions, declRef.getDecl(), out); + _printNestedDecl(declRef.getSubst(), declRef.getDecl(), out); } } @@ -773,7 +773,7 @@ DeclRef ExtractExistentialType::getSpecializedInterfaceDeclRef() SubtypeWitness* openedWitness = getSubtypeWitness(); ThisTypeSubstitution* openedThisType = m_astBuilder->create(); - openedThisType->outer = originalInterfaceDeclRef.substitutions.substitutions; + openedThisType->outer = originalInterfaceDeclRef.getSubst(); openedThisType->interfaceDecl = interfaceDecl; openedThisType->witness = openedWitness; -- cgit v1.2.3