Remove dangling initializers in GlobalDCE
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Mon, 25 Aug 2014 17:51:14 +0000 (17:51 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Mon, 25 Aug 2014 17:51:14 +0000 (17:51 +0000)
commitff69509f94bcb060b56907e11b3cafcec3c66f05
tree3a72c0a4ba174a12383672fb5f28966a4918582e
parenta696ccb89e17dd2b4f4b9c820a1e44778155f35c
Remove dangling initializers in GlobalDCE

GlobalDCE deletes global vars and updates their initializers to nullptr
while leaving underlying constants to be cleaned up later by its uses.
The clean up may never happen, fix this by forcing it every time it's
safe to destroy constants.

Final patch by Rafael Espindola
http://reviews.llvm.org/D4931

<rdar://problem/17523868>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216390 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/GlobalDCE.cpp
lib/Transforms/Utils/GlobalStatus.cpp
test/Transforms/GlobalDCE/deadblockaddr.ll [new file with mode: 0644]