Teach globalopt to not nuke all stores to globals. Keep them around of they
authorNick Lewycky <nicholas@mxc.ca>
Tue, 24 Jul 2012 07:21:08 +0000 (07:21 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Tue, 24 Jul 2012 07:21:08 +0000 (07:21 +0000)
commit8899d5c6fb3cf118c5c73eade290b6ebb2b3b850
tree18fe26d262870291e657e2c1699ca5eb916c033b
parentea0ca846478b8296f679afa419f2ad4e28073ad5
Teach globalopt to not nuke all stores to globals. Keep them around of they
might be deliberate "one time" leaks, so that leak checkers can find them.
This is a reapply of r160602 with the fix that this time I'm committing the
code I thought I was committing last time; the I->eraseFromParent() goes
*after* the break out of the loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160664 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/GlobalOpt.cpp
test/Transforms/GlobalOpt/2009-11-16-BrokenPerformHeapAllocSRoA.ll
test/Transforms/GlobalOpt/cleanup-pointer-root-users.ll [new file with mode: 0644]