Displaying 3 results from an estimated 3 matches for "abnormal_termin".
2015 Feb 13
2
[LLVMdev] C++ exception handling
(Moving this discussion on list as this could be of general interest.)
My current work-in-progress implementation is attempting to map out the blocks used by a landing pad before it starts outlining. It creates a table of catch and cleanup handlers with the block at which each one starts. During outlining I intend to have another mechanism to check to see if we’ve already outlined the handler
2015 Feb 13
2
[LLVMdev] C++ exception handling
...ave a conditional branch back over to the exceptional path.
// C++:
void f() {
__try { might_crash(); }
__finally {
mylabel: // better not emit twice!
int r; // better not emit twice!
r = do_cleanup();
if (!r)
goto mylabel;
}
}
// Simplified IR:
define void @f() {
%abnormal_termination = alloca i8
invoke void @might_crash()
to label %cont unwind label %lpad
cont:
store i8 0, i8* %abnormal_termination
br label %__finally
lpad:
landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
cleanup
store i8 1, i8* %abnormal_termination
br label %__...
2020 Apr 01
2
[RFC] [Windows SEH] Local_Unwind (Jumping out of a _finally) and -EHa (Hardware Exception Handling)
...unwind can take place in both paths too.
Let's demonstrate all possible paths in the following example.
try {
try {
try {
/* set counter = 1 */
Counter += 1;
if (ex)
RtlRaiseException(&ExceptionRecord);
} finally {
Counter += 1;
if (abnormal_termination()) {
printf(" inner finally: exception path \n\r");
}
else {
printf(" inner finally: normal path \n\r");
}
if (lu) {
printf(" inner finally: local unwind \n\r");
goto t10;
}
printf("...