From f78faf84a85262bf76295dfc5d85e1e7a942a4f2 Mon Sep 17 00:00:00 2001
From: Bill Wendling
The 'exception' label is a + landing pad for the + exception. As such, 'exception' label is required to have the + "landingpad" instruction, which contains + the information about about the behavior of the program after unwinding + happens, as its first non-PHI instruction. The restrictions on the + "landingpad" instruction's tightly couples it to the + "invoke" instruction, so that the important information contained + within the "landingpad" instruction can't be lost through normal + code motion.
+This instruction requires several arguments:
@@ -3372,17 +3384,18 @@ that the invoke/unwind semantics are likely to change in future versions. successors.The 'resume' instruction's argument must have the same type as the - result of any 'landingpad' instruction in the same function.
+The 'resume' instruction requires one argument, which must have the + same type as the result of the 'landingpad' instruction which + interrupted the unwinding.
The 'resume' instruction resumes propagation of an existing (in-flight) exception whose unwinding was interrupted with - a landingpad instruction.
+ a landingpad instruction.- resume { i8*, i32 } %exn + resume { i8*, i32 } %exn@@ -5970,6 +5983,79 @@ freestanding environments and non-C-based languages. + +
+ <resultval> = landingpad <somety> personality <type> <pers_fn> cleanup? <clause>+ + <clause> := catch <type> <value> + <clause> := filter <type> <value> ++ +
The 'landingpad' instruction is used by + LLVM's exception handling + system to specify that a basic block is a landing pad — one where + the exception lands, and corresponds to the code found in the + catch portion of a try/catch sequence. It + defines values supplied by the personality function (pers_fn) upon + re-entry to the function. The resultval has the + type somety.
+ +This instruction takes a pers_fn value. This is the personality + function associated with the unwinding mechanism. The optional + cleanup flag indicates that the landing pad block is a cleanup.
+ +A clause begins with the clause type — catch + or filter — and contains a list of global variables + representing the "types" that may be caught or filtered respectively. The + 'landingpad' instruction must contain at least + one clause or the cleanup flag.
+ +The 'landingpad' instruction defines the values which are set by the + personality function (pers_fn) upon re-entry to the function, and + therefore the "result type" of the landingpad instruction. As with + calling conventions, how the personality function results are represented in + LLVM IR is target specific.
+ +The landingpad instruction has several restrictions:
+ ++ ;; A landing pad which can catch an integer. + %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 + catch i8** @_ZTIi + ;; A landing pad that is a cleanup. + %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 + cleanup + ;; A landing pad which can catch an integer and can only throw a double. + %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 + catch i8** @_ZTIi + filter i8** @_ZTId ++ +