OSDN Git Service

MergeFunc: preserve COMDAT information when creating a thunk
authorSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 19 Apr 2019 01:48:36 +0000 (01:48 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 19 Apr 2019 01:48:36 +0000 (01:48 +0000)
commit667d4f41076c8eecf56aa6a4695575183948e116
tree7f2b21244e537a6a432e698dc32e9d5a121e1ab5
parent3cde9bb44e4b77890c14f461d7d425ea5f281712
MergeFunc: preserve COMDAT information when creating a thunk

We would previously drop the COMDAT on the thunk we generated when replacing a
function body with the forwarding thunk. This would result in a function that
may have been multiply emitted and multiply merged to be emitted with the same
name without the COMDAT. This is a hard error with PE/COFF where the COMDAT is
used for the deduplication of Value Witness functions for Swift.

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