[clang] [HLSL] add IsTypedResourceElementCompatible type trait (PR #114864)

Joshua Batista via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 5 10:37:42 PST 2024


================
@@ -2163,6 +2163,50 @@ static void BuildFlattenedTypeList(QualType BaseTy,
   }
 }
 
+bool SemaHLSL::IsTypedResourceElementCompatible(clang::QualType QT) {
+  if (QT.isNull())
+    return false;
+
+  // check if the outer type was an array type
+  if (QT->isArrayType())
+    return false;
+
+  llvm::SmallVector<QualType, 4> QTTypes;
+  BuildFlattenedTypeList(QT, QTTypes);
+
+  assert(QTTypes.size() > 0 &&
----------------
bob80905 wrote:

See https://github.com/llvm/llvm-project/pull/115045

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


More information about the cfe-commits mailing list