[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

Henrich Lauko via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 31 05:03:35 PDT 2025


================
@@ -1780,6 +1780,11 @@ LValue CIRGenFunction::emitLoadOfReferenceLValue(Address refAddr,
                         pointeeBaseInfo);
 }
 
+void CIRGenFunction::emitUnreachable(clang::SourceLocation loc) {
+  assert(!cir::MissingFeatures::sanitizers());
+  builder.create<cir::UnreachableOp>(getLoc(loc));
----------------
xlauko wrote:

```suggestion
  cir::UnreachableOp::create(builder, getLoc(loc));
```

https://github.com/llvm/llvm-project/pull/151363


More information about the cfe-commits mailing list