GlobalOpt: fix an issue where CXAAtExitFn points to a deleted function.
authorManman Ren <mren@apple.com>
Tue, 14 May 2013 21:52:44 +0000 (21:52 +0000)
committerManman Ren <mren@apple.com>
Tue, 14 May 2013 21:52:44 +0000 (21:52 +0000)
commit5150270d071f05c6ea1fd26ef448954ddb5746dc
tree2e628021377421f2d8b9834f4a579363766736ca
parente83a6f32a408d16f1fa07c658236eb226ea332fb
GlobalOpt: fix an issue where CXAAtExitFn points to a deleted function.

CXAAtExitFn was set outside a loop and before optimizations where functions
can be deleted. This patch will set CXAAtExitFn inside the loop and after
optimizations.

Seg fault when running LTO because of accesses to a deleted function.
rdar://problem/13838828

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