[cfe-dev] libc++ internals visibility rational

Mehdi Amini via cfe-dev cfe-dev at lists.llvm.org
Sat Apr 1 10:32:49 PDT 2017


The context is that I’m working on the plan here: http://lists.llvm.org/pipermail/cfe-dev/2016-July/049985.html

Trying to remove “all" of the “always_inline”, making the public APIs hidden, and the internal APIs “internal_linkage”.

The kind of discrepancy I mentioned below puzzles me though.

— 
Mehdi

> On Mar 31, 2017, at 11:49 PM, Eric Fiselier <eric at efcs.ca> wrote:
> 
> Honestly I've been wondering about the same things.
> 
> Libc++ needs to re-evaluate it's entire approach to symbol visibility especially w.r.t ABI management.
> I think a lot of the existing behavior is purely historical, and newer parts of the library just try to mimic that
> regardless of QoI. In particular I'm sceptical that libc++'s use of __always_inline__ helps prevent "ABI problems".
> 
> I would love to start a discussion on this, especially if it leads to concrete example
> that can be turned into test cases
> 
> /Eric
> 
> 
> On Fri, Mar 31, 2017 at 11:57 PM, Mehdi Amini via cfe-dev <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>> wrote:
> Similarly with the public free template functions:
> 
> 
> template <class _L0, class _L1>
> void
> lock(_L0& __l0, _L1& __l1)
> 
> and
> 
> template <class _L0, class _L1, class _L2, class ..._L3>
> inline _LIBCPP_INLINE_VISIBILITY
> void
> lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3& …__l3)
> 
> 
>> Mehdi
> 
> 
> 
> > On Mar 31, 2017, at 10:46 PM, Mehdi Amini via cfe-dev <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>> wrote:
> >
> > Hi,
> >
> > I’m wondering about libc++ visibility for the internals of the library. For example why do we define:
> >
> > _LIBCPP_INLINE_VISIBILITY
> >    void __construct_at_end(size_type __n, const_reference __x);
> >
> > with inline/hidden visibility, but not this one:
> >
> > template <class _ForwardIterator>
> > typename enable_if  <__is_forward_iterator<_ForwardIterator>::value, void>::type
> > __construct_at_end(_ForwardIterator __first, _ForwardIterator __last, size_type __n);
> >
> >
> > Thanks,
> >
> > —
> > Mehdi
> >
> > _______________________________________________
> > cfe-dev mailing list
> > cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev <http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev>
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev <http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev>
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170401/1ce86010/attachment.html>


More information about the cfe-dev mailing list