From a810aa31f5f366d69e67be96c169fec7d6041df7 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 7 Mar 2024 17:28:19 -0800 Subject: 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. --- source/slang/slang-check-conformance.cpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-check-conformance.cpp') 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(type)) { - return getTypeTags(arrayType->getElementType()); + auto typeTag = getTypeTags(arrayType->getElementType()); + bool sized = false; + if (auto cint = as(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(type)) { return getTypeTags(modifiedType->getBase()); } - if (auto declRefType = as(type)) + if (auto parameterGroupType = as(type)) + { + auto elementTags = getTypeTags(parameterGroupType->getElementType()); + elementTags = (TypeTag)((int)elementTags & ~(int)TypeTag::Unsized); + return elementTags; + } + else if (auto declRefType = as(type)) { if (auto aggTypeDecl = as(declRefType->getDeclRef())) return aggTypeDecl.getDecl()->typeTags; -- cgit v1.2.3