Fix a latent bug where, after emitting an expression statement, we would
authorJohn McCall <rjmccall@apple.com>
Wed, 12 Jan 2011 03:41:02 +0000 (03:41 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 12 Jan 2011 03:41:02 +0000 (03:41 +0000)
commitcd5b22e12b6513163dd131589746c194090f14e6
tree703d5e5877e2839f2dd62bbdae4b10a99da2060e
parent95a907fc0f2f717dca38a379c1d2353bfea06d4f
Fix a latent bug where, after emitting an expression statement, we would
delete the block we began emitting into if it had no predecessors.  We never
want to do this, because there are several valid cases during statement
emission where an existing block has no known predecessors but will acquire
some later.  The case in my test case doesn't inherently fall into this
category, because we could safely emit the case-range code before the statement
body, but there are examples with labels that can't be fallen into
that would also demonstrate this bug.

rdar://problem/8837067

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123303 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGBuiltin.cpp
lib/CodeGen/CGException.cpp
lib/CodeGen/CGStmt.cpp
test/CodeGen/switch.c