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

Justin Bogner via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 26 11:10:27 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();
----------------
bogner wrote:

I don't think we want to call `isHLSLSpecificType()` here - what if we add HLSL specific types that aren't intangible? I think a new `isHLSLIntangibleType()` would be more appropriate here (`isHLSLSpecificType()` can be updated to just `return isHLSLIntangibleType()`).

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


More information about the cfe-commits mailing list