]> granicus.if.org Git - clang/commit
[leaks] Fix a leak of a basic block when we successfully fold a switch
authorChandler Carruth <chandlerc@gmail.com>
Sat, 3 May 2014 00:14:49 +0000 (00:14 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 3 May 2014 00:14:49 +0000 (00:14 +0000)
commit011ceaf955ef9b050e8be66edc8ac28485066b59
tree5272883f74457714e06170315c05263619f063d1
parent6cdc03fcb19b503b108306f645c8b11cfccad65d
[leaks] Fix a leak of a basic block when we successfully fold a switch
condition to a constant and emit only the relevant statement. In that
case, we were previously creating the epilog jump destination, a cleanup
scope, and emitting any condition variable into it. Instead, we can emit
the condition variable (if we have one) into the cleanup scope used for
the entire folded case sequence. We avoid creating a jump dest, a basic
block, and an extra cleanup scope. Win!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207888 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGStmt.cpp