================
@@ -2074,16 +2074,24 @@ static cir::FuncOp getBadCastFn(CIRGenFunction &cgf) {
   // TODO(cir): set the calling convention of the runtime function.
   assert(!cir::MissingFeatures::opFuncCallingConv());
 
+  mlir::NamedAttrList attrs;
+  attrs.set(cir::CIRDialect::getNoReturnAttrName(),
+            mlir::UnitAttr::get(&cgf.cgm.getMLIRContext()));
+
   cir::FuncType fnTy =
       cgf.getBuilder().getFuncType({}, cgf.getBuilder().getVoidTy());
-  return cgf.cgm.createRuntimeFunction(fnTy, "__cxa_bad_cast");
+  return cgf.cgm.createRuntimeFunction(fnTy, "__cxa_bad_cast", attrs);
----------------
andykaylor wrote:

This isn't necessary. Setting the attribute on the call site is sufficient and 
matches the classic codegen behavior.

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

Reply via email to