]> granicus.if.org Git - clang/commit
Fix linkage of static locals in available_externally functions to be DiscardableODR...
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 27 Jan 2017 23:11:10 +0000 (23:11 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 27 Jan 2017 23:11:10 +0000 (23:11 +0000)
commit9f8ada6d54fa46df84248f65ec5d6269114c9640
treed2d1bd2986ed77aaf50d3415053d30c8ccbce7e7
parentb43c9aaed9ad87912ac02de3854d56ddad84321a
Fix linkage of static locals in available_externally functions to be DiscardableODR/linkonce_odr

As Mehdi put it, entities should either be
available_externally+weak_odr, or linkonce_odr+linkonce_odr. While some
functions are emitted a_e/weak, their local variables were emitted
a_e/linkonce_odr.

While it might be nice to emit them a_e/weak, the Itanium ABI (& best
guess at MSVC's behavior as well) requires the local to be
linkonce/linkonce.

Reviewers: rsmith, mehdi_amini

Differential Revision: https://reviews.llvm.org/D29233

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293344 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/ASTContext.cpp
test/CodeGenCXX/explicit-instantiation.cpp