MergeFunctions: Impose a total order on the replacement of functions
authorArnold Schwaighofer <aschwaighofer@apple.com>
Tue, 9 Jun 2015 00:03:29 +0000 (00:03 +0000)
committerArnold Schwaighofer <aschwaighofer@apple.com>
Tue, 9 Jun 2015 00:03:29 +0000 (00:03 +0000)
commit04ed4447eed9e3717da4c5729e55f7431e2196b9
tree8bd5bbf4591e7b8981aa8730da68eda147d3bd38
parent38a2b24c12669a99109801650eca1567b3a855f4
MergeFunctions: Impose a total order on the replacement of functions

We don't want to replace function A by Function B in one module and Function B
by Function A in another module.

If these functions are marked with linkonce_odr we would end up with a function
stub calling B in one module and a function stub calling A in another module. If
the linker decides to pick these two we will have two stubs calling each other.

rdar://21265586

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239367 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/MergeFunctions.cpp
test/Transforms/MergeFunc/call-and-invoke-with-ranges.ll
test/Transforms/MergeFunc/linkonce_odr.ll [new file with mode: 0644]