Bugfix for PR17099:
authorStepan Dyatkovskiy <stpworld@narod.ru>
Tue, 17 Sep 2013 09:36:11 +0000 (09:36 +0000)
committerStepan Dyatkovskiy <stpworld@narod.ru>
Tue, 17 Sep 2013 09:36:11 +0000 (09:36 +0000)
commit80361492ae7ea9fedbb5a55c72d4aea6a3d600b1
tree05554a6991b6f0fb1d15df004d0ee5b282392dc1
parent8e5fae2b1bee2b7a944360b91df0d223d06b7927
Bugfix for PR17099:
Wrong cast operation.
MergeFunctions emits Bitcast instead of pointer-to-integer operation.
Patch fixes MergeFunctions::writeThunk function. It replaces
unconditional Bitcast creation with "Value* createCast(...)" method, that
checks operand types and selects proper instruction.
See unit-test as example.

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