[clang] [llvm] [SystemZ] Add support for __builtin_setjmp and __builtin_longjmp (PR #116642)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 19 14:18:47 PST 2024


================
@@ -4619,6 +4619,12 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
     // Buffer is a void**.
     Address Buf = EmitPointerWithAlignment(E->getArg(0));
 
+    if (getTarget().getTriple().getArch() == llvm::Triple::systemz) {
+      // Call LLVM's EH setjmp, which is lightweight.
----------------
efriedma-quic wrote:

I'm a little concerned about modifying the semantics of the intrinsic like this.  I mean, the semantics are inherently a bit platform-specific, but this contradicts the documentation in llvm/docs/ExceptionHandling.rst.

If we need different semantics here for some reason, I'd prefer to use an intrinsic with a different name, to avoid any confusion.

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


More information about the cfe-commits mailing list