https://github.com/andykaylor updated 
https://github.com/llvm/llvm-project/pull/244742

>From 2efd4b7b9ceb8fcd4be3e025a7780ee20e9e29fb Mon Sep 17 00:00:00 2001
From: Andy Kaylor <[email protected]>
Date: Fri, 20 Nov 2026 14:52:47 -0800
Subject: [PATCH 1/2] [CIR] Improve a couple of NYI diagnostics

This change adds an NYI diagnostic for block pointer callees and improves
the information for the general fallback diagnostic in
CIRGenFunction::emitLValue.

This produces a more specific diagnostic for the missing functionality
reported in https://github.com/llvm/llvm-project/issues/243877
---
 clang/lib/CIR/CodeGen/CIRGenExpr.cpp     | 7 +++++++
 clang/lib/CIR/CodeGen/CIRGenFunction.cpp | 5 +++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/clang/lib/CIR/CodeGen/CIRGenExpr.cpp 
b/clang/lib/CIR/CodeGen/CIRGenExpr.cpp
index 14703360c608d2..5632fa9d768a42 100644
--- a/clang/lib/CIR/CodeGen/CIRGenExpr.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenExpr.cpp
@@ -2732,6 +2732,13 @@ RValue CIRGenFunction::emitCallExpr(const 
clang::CallExpr *e,
                                     ReturnValueSlot returnValue) {
   assert(!cir::MissingFeatures::objCBlocks());
 
+  // Builtins never have block type.
+  if (e->getCallee()->getType()->isBlockPointerType()) {
+    cgm.errorNYI(e->getSourceRange(),
+                 std::string("emitCallExpr: block pointer type"));
+    return getUndefRValue(e->getType());
+  }
+
   if (const auto *ce = dyn_cast<CXXMemberCallExpr>(e))
     return emitCXXMemberCallExpr(ce, returnValue);
 
diff --git a/clang/lib/CIR/CodeGen/CIRGenFunction.cpp 
b/clang/lib/CIR/CodeGen/CIRGenFunction.cpp
index 23fbd963ef7864..9fd44d0c4671ae 100644
--- a/clang/lib/CIR/CodeGen/CIRGenFunction.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenFunction.cpp
@@ -1237,8 +1237,9 @@ LValue CIRGenFunction::emitLValue(const Expr *e) {
   assert(!cir::MissingFeatures::generateDebugInfo());
   switch (e->getStmtClass()) {
   default:
-    getCIRGenModule().errorNYI(e->getSourceRange(),
-                               "emitLValue: unsupported l-value class");
+    cgm.errorNYI(e->getSourceRange(),
+                 std::string("emitLValue: unsupported l-value class: ") +
+                   e->getStmtClassName());
     return LValue();
 
   case Expr::ObjCPropertyRefExprClass:

>From 2df6ec5c59d00f0be691802ad141d94a4288404b Mon Sep 17 00:00:00 2001
From: Andy Kaylor <[email protected]>
Date: Fri, 20 Nov 2026 17:04:38 -0800
Subject: [PATCH 2/2] Fix formatting

---
 clang/lib/CIR/CodeGen/CIRGenFunction.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/CIR/CodeGen/CIRGenFunction.cpp 
b/clang/lib/CIR/CodeGen/CIRGenFunction.cpp
index 9fd44d0c4671ae..5b182415aa64b1 100644
--- a/clang/lib/CIR/CodeGen/CIRGenFunction.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenFunction.cpp
@@ -1239,7 +1239,7 @@ LValue CIRGenFunction::emitLValue(const Expr *e) {
   default:
     cgm.errorNYI(e->getSourceRange(),
                  std::string("emitLValue: unsupported l-value class: ") +
-                   e->getStmtClassName());
+                     e->getStmtClassName());
     return LValue();
 
   case Expr::ObjCPropertyRefExprClass:

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

Reply via email to