diff options
| author | Yong He <yonghe@outlook.com> | 2024-03-07 17:28:19 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-07 17:28:19 -0800 |
| commit | a810aa31f5f366d69e67be96c169fec7d6041df7 (patch) | |
| tree | 3c8697241d8f3381720661b6f5d3cdaac7789f5d /source/slang/slang-check-conformance.cpp | |
| parent | 6492906ebe59b573f6243e7c44476944b9dd5592 (diff) | |
Link-time constant and linkage API improvements. (#3708)
* Link-time constant and linkage API improvements.
* Fix.
* Allow module name to be empty.
* Fix.
* Fix.
* Fix compile error.
Diffstat (limited to 'source/slang/slang-check-conformance.cpp')
| -rw-r--r-- | source/slang/slang-check-conformance.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/source/slang/slang-check-conformance.cpp b/source/slang/slang-check-conformance.cpp index e73c0723b..d6e73e798 100644 --- a/source/slang/slang-check-conformance.cpp +++ b/source/slang/slang-check-conformance.cpp @@ -264,13 +264,35 @@ namespace Slang { if (auto arrayType = as<ArrayExpressionType>(type)) { - return getTypeTags(arrayType->getElementType()); + auto typeTag = getTypeTags(arrayType->getElementType()); + bool sized = false; + if (auto cint = as<ConstantIntVal>(arrayType->getElementCount())) + { + if (cint->getValue() != kUnsizedArrayMagicLength) + { + sized = true; + } + } + else if (auto intVal = arrayType->getElementCount()) + { + sized = !intVal->isLinkTimeVal(); + } + if (!sized) + typeTag = (TypeTag)((int)typeTag | (int)TypeTag::Unsized); + + return typeTag; } if (auto modifiedType = as<ModifiedType>(type)) { return getTypeTags(modifiedType->getBase()); } - if (auto declRefType = as<DeclRefType>(type)) + if (auto parameterGroupType = as<UniformParameterGroupType>(type)) + { + auto elementTags = getTypeTags(parameterGroupType->getElementType()); + elementTags = (TypeTag)((int)elementTags & ~(int)TypeTag::Unsized); + return elementTags; + } + else if (auto declRefType = as<DeclRefType>(type)) { if (auto aggTypeDecl = as<AggTypeDecl>(declRefType->getDeclRef())) return aggTypeDecl.getDecl()->typeTags; |
