OSDN Git Service

[ThinLTO] Don't internalize weak writeable variables
authorEugene Leviant <eleviant@accesssoftek.com>
Mon, 13 May 2019 11:53:05 +0000 (11:53 +0000)
committerEugene Leviant <eleviant@accesssoftek.com>
Mon, 13 May 2019 11:53:05 +0000 (11:53 +0000)
commitfd1c3442d97a3e9582ba62d74e19923e3d5d9da1
treece2e28980df7a6e46e2da2f83a621b8392cd4db9
parentc564410fc547cdfa970e559b31be9e019c95ce94
[ThinLTO] Don't internalize weak writeable variables

Variables with linkonce_odr and weak_odr linkage shouldn't be internalized
if they're not readonly. Otherwise we may end up with multiple copies of
such variable, so reads and writes will become inconsistent

Differential revision: https://reviews.llvm.org/D61255

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360577 91177308-0d34-0410-b5e6-96231b3b80d8
lib/LTO/LTO.cpp
test/ThinLTO/X86/weak_externals.ll [new file with mode: 0644]