[clang] [CIR][NFC] ComplexType visitStmt replace NYI with unreachable (PR #185178)

Amr Hesham via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 7 03:44:15 PST 2026


https://github.com/AmrDeveloper created https://github.com/llvm/llvm-project/pull/185178

Replace errorNYI with llvm_unreachable in ComplexType visitStmt

>From 69ce6c486bbac5ccfb017919959f94e10573844a Mon Sep 17 00:00:00 2001
From: Amr Hesham <amr96 at programmer.net>
Date: Sat, 7 Mar 2026 12:42:54 +0100
Subject: [PATCH] [CIR][NFC] ComplexType visitStmt replace NYI with unreachable

---
 clang/lib/CIR/CodeGen/CIRGenExprComplex.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/lib/CIR/CodeGen/CIRGenExprComplex.cpp b/clang/lib/CIR/CodeGen/CIRGenExprComplex.cpp
index c57f9a3b2ce9d..ff5a58a8eb122 100644
--- a/clang/lib/CIR/CodeGen/CIRGenExprComplex.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenExprComplex.cpp
@@ -61,8 +61,8 @@ class ComplexExprEmitter : public StmtVisitor<ComplexExprEmitter, mlir::Value> {
   }
 
   mlir::Value VisitStmt(Stmt *s) {
-    cgf.cgm.errorNYI(s->getBeginLoc(), "ComplexExprEmitter VisitStmt");
-    return {};
+    s->dump(llvm::errs(), cgf.getContext());
+    llvm_unreachable("Stmt can't have complex result type!");
   }
 
   mlir::Value VisitExpr(Expr *e);



More information about the cfe-commits mailing list