Skip to content

Commit 8405d02

Browse files
committed
[CIR] removed casting in longjmp codegen
1 parent f177707 commit 8405d02

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1964,12 +1964,10 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
19641964
return RValue::get(op);
19651965
}
19661966
case Builtin::BI__builtin_longjmp: {
1967-
Address buf = emitPointerWithAlignment(E->getArg(0));
1967+
mlir::Value buf = emitScalarExpr(E->getArg(0));
19681968
mlir::Location loc = getLoc(E->getExprLoc());
19691969

1970-
cir::PointerType ppTy = builder.getPointerTo(builder.getVoidPtrTy());
1971-
mlir::Value castBuf = builder.createBitcast(buf.getPointer(), ppTy);
1972-
cir::EhLongjmpOp::create(builder, loc, castBuf);
1970+
cir::EhLongjmpOp::create(builder, loc, buf);
19731971
builder.create<cir::UnreachableOp>(loc);
19741972
return RValue::get(nullptr);
19751973
}

0 commit comments

Comments
 (0)