[CodeGen] Suppress emission of lifetime markers if a label has been seen
in the current lexical scope.
clang currently emits the lifetime.start marker of a variable when the
variable comes into scope even though a variable's lifetime starts at
the entry of the block with which it is associated, according to the C
standard. This normally doesn't cause any problems, but in the rare case
where a goto jumps backwards past the variable declaration to an earlier
point in the block (see the test case added to lifetime2.c), it can
cause mis-compilation.
To prevent such mis-compiles, this commit conservatively disables
emitting lifetime variables when a label has been seen in the current
block.
This problem was discussed on cfe-dev here:
http://lists.llvm.org/pipermail/cfe-dev/2016-July/050066.html
rdar://problem/
30153946
Differential Revision: https://reviews.llvm.org/D27680
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293106
91177308-0d34-0410-b5e6-
96231b3b80d8