This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Remove inline/visibility attributes from exported template methods in valarray.
Needs ReviewPublic

Authored by eugenis on Dec 10 2015, 2:13 PM.

Details

Reviewers
EricWF
Summary

This does not affect the libc++ export list now.
It is required for internal_linkage switch to not affect the libc++ export list.
This patch is on top of D15432.

Diff Detail

Repository
rL LLVM

Event Timeline

eugenis updated this revision to Diff 42463.Dec 10 2015, 2:13 PM
eugenis retitled this revision from to [libcxx] Remove inline/visibility attributes from exported template methods in valarray..
eugenis updated this object.
eugenis added a reviewer: EricWF.
eugenis set the repository for this revision to rL LLVM.
eugenis added a subscriber: cfe-commits.
EricWF edited edge metadata.Dec 10 2015, 5:37 PM

Won't this mean that libc++ possibly exports 3 more template definitions? I think this is likely safe but I would rather not export any more symbols if it can be avoided.

I'm probably nitpicking here though.

include/valarray
823

So I think we still want the almost every instantiation of valarray<Tp>::~valarray() to have internal linkage except for the specialization valarray<size_t>::~valarray(); Do you see any way to make this possible?

Libc++.so does not instantiate valarray for any other types, so this does not add any extra exports.

Definitions valarray members (with types other than size_t) will now be exported from user code. This looks like a positive change to me:

  • these methods are already part of the ABI due to the exported template valarray<size_t>
  • exported vs hidden/internal can produce smaller code