From 00484d15aad5a9732ee0f966ceb68bce90cb9f27 Mon Sep 17 00:00:00 2001
From: Jim Grosbach Setjmp/Longjmp (SJLJ) based exception handling uses LLVM intrinsics
+ llvm.eh.sjlj.setjmp and
+ llvm.eh.sjlj.longjmp to
+ handle control flow for exception handling. For each function which does exception processing, be it try/catch blocks
+ or cleanups, that function registers itself on a global frame list. When
+ exceptions are being unwound, the runtime uses this list to identify which
+ functions need processing.
+
+ Landing pad selection is encoded in the call site entry of the function
+ context. The runtime returns to the function via
+ llvm.eh.sjlj.longjmp, where
+ a switch table transfers control to the appropriate landing pad based on
+ the index stored in the function context. In contrast to DWARF exception handling, which encodes exception regions
+ and frame information in out-of-line tables, SJLJ exception handling
+ builds and removes the unwind frame context at runtime. This results in
+ faster exception handling at the expense of slower execution when no
+ exceptions are thrown. As exceptions are, by their nature, intended for
+ uncommon code paths, DWARF exception handling is generally preferred to
+ SJLJ.