]> granicus.if.org Git - clang/commit
Emit @finally blocks completely lazily instead of forcing their
authorJohn McCall <rjmccall@apple.com>
Wed, 22 Jun 2011 02:32:12 +0000 (02:32 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 22 Jun 2011 02:32:12 +0000 (02:32 +0000)
commitd768e9d29abe1ac1ccc3ed63f2dce835d9bab342
tree70f54ed568bf18e819cc844e1a0e2d4a42313a8f
parent4dba7b56d4551b7e03e20eeb7f45e5c962baa20c
Emit @finally blocks completely lazily instead of forcing their
existence by always threading an edge from the catchall.  Not doing
this was previously causing a crash in the very extreme case where
neither the normal cleanup nor the EH catchall was actually reachable:
we would delete the catchall entry block, which would cause us to
delete the entry block of the finally cleanup as well because the
cleanup logic would merge the blocks, which in turn triggered an assert
because later blocks in the finally would still be using values from the
entry.  Laziness turns out to be the most elegant solution to the problem.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133601 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGException.cpp
lib/CodeGen/CGObjCRuntime.cpp
lib/CodeGen/CodeGenFunction.h
test/CodeGenObjC/exceptions-nonfragile.m