================
@@ -4332,6 +4039,140 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned 
BuiltinID, CallExpr *TheCall) {
                                getASTContext().UnsignedIntTy);
     break;
   }
+  case Builtin::BI__builtin_hlsl_interlocked_or: {
+    if (SemaRef.checkArgCountRange(TheCall, 3, 4))
+      return true;
+    const ASTContext &AST = SemaRef.getASTContext();
+
+    auto checkResTy = [&](const HLSLAttributedResourceType *ResTy) -> bool {
+      bool IsValid = false;
+      const bool IsUAV = ResTy->getAttrs().ResourceClass == ResourceClass::UAV;
+      const bool HasElemTy = ResTy->hasContainedType();
+      const bool IsRaw = ResTy->isRaw();
+      const bool IsTexture = ResTy->isTexture();
+      const bool IsIntElem =
+          HasElemTy && (ResTy->getContainedType() == AST.IntTy ||
+                        ResTy->getContainedType() == AST.UnsignedIntTy);
+      const bool IsLongElem =
+          HasElemTy && (ResTy->getContainedType() == AST.LongTy ||
+                        ResTy->getContainedType() == AST.UnsignedLongTy);
+
+      // The resource handle must be either
----------------
Alexander-Johnston wrote:

Meant to be finished by the comments in the conditions below. I'll modify to a 
series of `if`s and see if it reads better.

https://github.com/llvm/llvm-project/pull/180804
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to