[clang] [HLSL] add IsLineVectorLayoutCompatible type trait (PR #113730)

Finn Plummer via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 25 14:16:56 PDT 2024


================
@@ -2163,6 +2163,49 @@ static void BuildFlattenedTypeList(QualType BaseTy,
   }
 }
 
+bool SemaHLSL::IsLineVectorLayoutCompatibleType(clang::QualType QT) {
+  if (QT.isNull())
+    return false;
+
+  llvm::SmallVector<QualType, 16> QTTypes;
+  BuildFlattenedTypeList(QT, QTTypes);
+
+  QualType FirstQT = QTTypes[0];
----------------
inbelic wrote:

Maybe we could add an assert on the vector size or a check with `llvm_unreachable` when size is 0

https://github.com/llvm/llvm-project/pull/113730


More information about the cfe-commits mailing list