[clang] [HLSL] Implement '__builtin_hlsl_is_intangible' type trait (PR #104544)

Greg Roth via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 26 12:40:34 PDT 2024


================
@@ -1154,3 +1156,70 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
   }
   return false;
 }
+
+static bool calculateIsIntangibleType(QualType Ty) {
+  Ty = Ty->getCanonicalTypeUnqualified();
+  if (Ty->isBuiltinType())
+    return Ty->isHLSLSpecificType();
+
+  llvm::SmallVector<QualType, 8> TypesToScan;
+  TypesToScan.push_back(Ty);
+  while (!TypesToScan.empty()) {
+    QualType T = TypesToScan.pop_back_val();
+    assert(T == T->getCanonicalTypeUnqualified() && "expected sugar-free type");
+    assert(!isa<MatrixType>(T) && "Matrix types not yet supported in HLSL");
----------------
pow2clk wrote:

I don't think matrices will be intangible types nor can they contain them anyway?

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


More information about the cfe-commits mailing list