Make multiversioning work with internal linkage
authorErich Keane <erich.keane@intel.com>
Thu, 16 Sep 2021 16:57:54 +0000 (09:57 -0700)
committerErich Keane <erich.keane@intel.com>
Fri, 17 Sep 2021 12:56:38 +0000 (05:56 -0700)
commite3b10525b489b604d6a1e540be78bda80afb5868
tree7c5f5dfa12e3b7c8795e84d09b3104e2798e57aa
parent58719f61535e8c585ebeb96e6f7c340bbf1f769c
Make multiversioning work with internal linkage

We previously made all multiversioning resolvers/ifuncs have weak
ODR linkage in IR, since we NEED to emit the whole resolver every time
we see a call, but it is not necessarily the place where all the
definitions live.

HOWEVER, when doing so, we neglected the case where the versions have
internal linkage.  This patch ensures we do this, so you don't get weird
behavior with static functions.
clang/lib/CodeGen/CodeGenModule.cpp
clang/test/CodeGen/unique-internal-linkage-names.cpp
clang/test/CodeGenCXX/multi-versioning-internal-linkage.cpp [new file with mode: 0644]