================
@@ -576,4 +578,52 @@ bool SemaOpenCL::checkBuiltinToAddr(unsigned BuiltinID, 
CallExpr *Call) {
   return false;
 }
 
+void SemaOpenCL::checkBuiltinReadImage(FunctionDecl *FDecl, CallExpr *Call) {
+  IdentifierInfo *II = FDecl->getIdentifier();
+  if (!II)
+    return;
+  StringRef Name = II->getName();
+  if (Name != "read_imagei" && Name != "read_imageui")
+    return;
+
+  // read_image{i|ui} with a sampler take (image, sampler, coord).
+  // Bail out samplerless overloads (image, coord) — 2 args.
+  if (Call->getNumArgs() < 3)
+    return;
+  Expr *SamplerArg = Call->getArg(1);
+  QualType ArgTy = SamplerArg->getType().getCanonicalType();
----------------
svenvh wrote:

I wonder if we should be checking if the param type of `FDecl` is a sampler?

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

Reply via email to