[clang] [HLSL] add IsLineVectorLayoutCompatible type trait (PR #113730)
Helena Kotas via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 30 11:11:40 PDT 2024
================
@@ -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);
----------------
hekota wrote:
This certainly works, but I wonder if building up the full flattened type is really needed. You just need to scan the type and make sure all elements are the same and get the total size while doing that. That should not require a separate list and allocations.
https://github.com/llvm/llvm-project/pull/113730
More information about the cfe-commits
mailing list