diff options
| author | Yong He <yonghe@outlook.com> | 2023-07-07 14:26:37 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-07 14:26:37 -0700 |
| commit | 643aaa13d2c6e0c4994437aa9fba6716787608ce (patch) | |
| tree | 279794cfafecc89f0be133d2a81750d59d9ee94a /source/slang/slang-ast-type.cpp | |
| parent | fb6605c2a7bc17d3b3b79dabd07e1f05267eb33a (diff) | |
Make DeclRefBase a Val, and DeclRef<T> a helper class. (#2967)
* Make DeclRefBase a Val, and DeclRef<T> 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 <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ast-type.cpp')
| -rw-r--r-- | source/slang/slang-ast-type.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
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<Type>(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[0]); + return as<Type>(findInnerMostGenericSubstitution(declRef.getSubst())->getArgs()[0]); } @@ -304,17 +304,17 @@ BasicExpressionType* MatrixExpressionType::_getScalarTypeOverride() Type* MatrixExpressionType::getElementType() { - return as<Type>(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[0]); + return as<Type>(findInnerMostGenericSubstitution(declRef.getSubst())->getArgs()[0]); } IntVal* MatrixExpressionType::getRowCount() { - return as<IntVal>(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[1]); + return as<IntVal>(findInnerMostGenericSubstitution(declRef.getSubst())->getArgs()[1]); } IntVal* MatrixExpressionType::getColumnCount() { - return as<IntVal>(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[2]); + return as<IntVal>(findInnerMostGenericSubstitution(declRef.getSubst())->getArgs()[2]); } Type* MatrixExpressionType::getRowType() @@ -330,12 +330,12 @@ Type* MatrixExpressionType::getRowType() Type* ArrayExpressionType::getElementType() { - return as<Type>(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[0]); + return as<Type>(findInnerMostGenericSubstitution(declRef.getSubst())->getArgs()[0]); } IntVal* ArrayExpressionType::getElementCount() { - return as<IntVal>(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[1]); + return as<IntVal>(findInnerMostGenericSubstitution(declRef.getSubst())->getArgs()[1]); } void ArrayExpressionType::_toTextOverride(StringBuilder& out) @@ -441,7 +441,7 @@ Type* NamespaceType::_createCanonicalTypeOverride() Type* DifferentialPairType::getPrimalType() { - return as<Type>(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[0]); + return as<Type>(findInnerMostGenericSubstitution(declRef.getSubst())->getArgs()[0]); } @@ -449,12 +449,12 @@ Type* DifferentialPairType::getPrimalType() Type* PtrTypeBase::getValueType() { - return as<Type>(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[0]); + return as<Type>(findInnerMostGenericSubstitution(declRef.getSubst())->getArgs()[0]); } Type* OptionalType::getValueType() { - return as<Type>(findInnerMostGenericSubstitution(declRef.substitutions)->getArgs()[0]); + return as<Type>(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<InterfaceDecl> ExtractExistentialType::getSpecializedInterfaceDeclRef() SubtypeWitness* openedWitness = getSubtypeWitness(); ThisTypeSubstitution* openedThisType = m_astBuilder->create<ThisTypeSubstitution>(); - openedThisType->outer = originalInterfaceDeclRef.substitutions.substitutions; + openedThisType->outer = originalInterfaceDeclRef.getSubst(); openedThisType->interfaceDecl = interfaceDecl; openedThisType->witness = openedWitness; |
