================ @@ -2163,6 +2163,51 @@ static void BuildFlattenedTypeList(QualType BaseTy, } } +bool SemaHLSL::IsLineVectorLayoutCompatibleType(clang::QualType QT) { + if (QT.isNull()) + return false; + + llvm::SmallVector<QualType, 16> QTTypes; + BuildFlattenedTypeList(QT, QTTypes); + + assert(QTTypes.size() > 0 && + "expected at least one constituent type from non-null type"); + QualType FirstQT = QTTypes[0]; + + // element count cannot exceed 4 + if (QTTypes.size() > 4) + return false; + + // check if the outer type was an array type + if (llvm::isa<clang::ArrayType>(QT.getTypePtr())) ---------------- hekota wrote:
```suggestion if (QT->isArrayType()) ``` and you can move this check higher before building the flattened list. https://github.com/llvm/llvm-project/pull/113730 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits