Fix an infinite loop; merging two functions will create a new function (if the
commit5a2e4d83b41d4519f33486dfaec106bf94667c73
authorNick Lewycky <nicholas@mxc.ca>
Tue, 31 Aug 2010 08:29:37 +0000 (31 08:29 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Tue, 31 Aug 2010 08:29:37 +0000 (31 08:29 +0000)
tree9d0953592dd90eab6a402547be114f0626772ca4
parent8eb36cc572ff8114672b0f2c07e1b7141355780e
Fix an infinite loop; merging two functions will create a new function (if the
two are weak, we make them thunks to a new strong function) so don't iterate
through the function list as we're modifying it.

Also add back the outermost loop which got removed during the cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112595 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/MergeFunctions.cpp