Teach globalopt to play nice with leak checkers. This is a reapplication of
authorNick Lewycky <nicholas@mxc.ca>
Sat, 21 Jul 2012 08:29:45 +0000 (08:29 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Sat, 21 Jul 2012 08:29:45 +0000 (08:29 +0000)
commit61e2ff8f821beec2eefdbb21a5954f74b1c0a295
tree83622d2e1b9b9d0f8f9ad3217d8889147a7dafff
parent60287963c7505180500d63b1c1b90f0f4b337430
Teach globalopt to play nice with leak checkers. This is a reapplication of
r160529 that was subsequently reverted. The fix was to not call
GV->eraseFromParent() right before the caller does the same. The existing
testcases already caught this bug if run under valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160602 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]