Page MenuHomePhabricator

Fix linkage of static locals in available_externally functions to be DiscardableODR/linkonce_odr
ClosedPublic

Authored by dblaikie on Jan 27 2017, 2:04 PM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

dblaikie created this revision.Jan 27 2017, 2:04 PM
mehdi_amini accepted this revision.Jan 27 2017, 2:11 PM

LGTM.

lib/AST/ASTContext.cpp
8909 ↗(On Diff #86118)

I assume you looked it up, do you have a ref? (Citation or pointer to right section/paragraph).

This revision is now accepted and ready to land.Jan 27 2017, 2:11 PM
dblaikie updated this revision to Diff 86137.Jan 27 2017, 3:21 PM

Improve comment/mention Itanium ABI

This revision was automatically updated to reflect the committed changes.