================
@@ -621,18 +622,35 @@
ItaniumEHLowering::resolveCatchCopyThunk(cir::ConstructCatchParamOp op) {
mlir::LogicalResult
ItaniumEHLowering::lowerConstructCatchParam(cir::ConstructCatchParamOp op,
mlir::Value exnPtr) {
+ mlir::Location loc = op.getLoc();
+ mlir::Value paramAddr = op.getParamAddr();
+ cir::PointerType paramAddrType =
+ mlir::cast<cir::PointerType>(paramAddr.getType());
+
+ if (op.getKind() == cir::InitCatchKind::Reference) {
+ assert(!MissingFeatures::winSizeOfUnwindException());
+ constexpr unsigned headerSize = 32;
+
+ builder.setInsertionPoint(op);
+ auto index = cir::ConstantOp::create(
+ builder, loc, cir::IntAttr::get(u32Type, headerSize));
+ auto exnObj =
+ cir::PtrStrideOp::create(builder, loc, exnPtr.getType(), exnPtr,
index);
----------------
andykaylor wrote:
Is `exnPtr.getType` here guaranteed to be `void*` or `i8*`? Maybe add an
assertion, because this PtrStrideOp will be incorrect otherwise.
https://github.com/llvm/llvm-project/pull/195722
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits