Displaying 2 results from an estimated 2 matches for "might_crash".
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
...has the invariant that it cannot double-emit local declarations twice while emitting a function. So for this test case, we had to make the exceptional cleanup path branch into normal path with a phi, and then have 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...