[LLVMdev] built-in longjmp and setjmp

Jim Grosbach grosbach at apple.com
Wed Apr 27 16:25:30 PDT 2011

On Apr 27, 2011, at 4:08 PM, Joerg Sonnenberger wrote:

> On Wed, Apr 27, 2011 at 03:55:53PM -0700, Jim Grosbach wrote:
>> The builtins are for internal compiler use in the context of SjLj
>> exception handling. Any other use, including any direct calls of the
>> builtins in user code, are a bad idea with no guaranteed behaviour.
>> That they're exposed at all is, again, for historical purposes. Don't use them. 
> Why is longjmp converted into calls to the builtin then?
> See PR 8765.

Hi Joerg,

If I follow what's happing in PR8765 correctly, it's a bit different. setjmp/longjmp calls are never lowered to the builtin EH intrinsics. Unfortunately, "builtin" is a bit of an overloaded term. :( Something else is recognizing the "setjmp" name as special and is doing something with it (e.g., SelectionDAGISel checks for it as well as a few other "returns twice" functions).


More information about the llvm-dev mailing list