llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clangir

Author: Andy Kaylor (andykaylor)

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/244742.diff


2 Files Affected:

- (modified) clang/lib/CIR/CodeGen/CIRGenExpr.cpp (+7) 
- (modified) clang/lib/CIR/CodeGen/CIRGenFunction.cpp (+3-2) 


``````````diff
diff --git a/clang/lib/CIR/CodeGen/CIRGenExpr.cpp 
b/clang/lib/CIR/CodeGen/CIRGenExpr.cpp
index 14703360c608d..5632fa9d768a4 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 23fbd963ef786..9fd44d0c4671a 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:

``````````

</details>


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

Reply via email to