<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 29, 2017 at 9:00 PM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Why are we propagating the use of always_inline?<br></blockquote><div><br></div><div>The intent of this change wasn't to propagate or remove always_inline from any functions. It was to fix incompatible dylibs built by GCC.</div><div>The way it did that is by removing the __attribute__((visibility("hidden"))) part while building the dylib, because GCC was ignoring the</div><div>`visibility("default")` on the extern template declarations for basic string.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
In other places, we use always_inline to avoid affecting ABI (a visibility hack).  But you're not removing basic_string from the dylib here.<br></blockquote><div><br></div><div>That's a very good point. It's likely we should convert many of the `_LIBCPP_ALWAYS_INLINE`s to inline instead and the compiler should</div><div>do the right thing. However that change is orthogonal to this one, and hence it wasn't made here.</div><div><br></div><div>Also I think the doc for _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY is misleading. I'll try to update it in the coming days.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
It has major downsides:<br>
- It causes inlining at -O0, which causes major regressions in debugging experiences.<br>
- It causes inlining at -O0, which, without other optimizations, can blow up stack size of static_initializers.<br>
- It overrides the inliner heuristics, which *should* be smarter.<br>
<br>
Why can't we get away with just the `inline` keyword and trust the compiler (and/or fix the compiler)?<br>
<div class="HOEnZb"><div class="h5"><br>
> On Sep 15, 2016, at 17:00, Eric Fiselier via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br>
><br>
> Author: ericwf<br>
> Date: Thu Sep 15 19:00:48 2016<br>
> New Revision: 281681<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=281681&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=281681&view=rev</a><br>
> Log:<br>
> [libc++] Add _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY to support GCC ABI compatibility<br>
><br>
> Summary:<br>
> GCC and Clang handle visibility attributes on the out-of-line definition of externally instantiated templates differently. For example in the reproducer below Clang will emit both 'foo' and 'bar' with default visibility while GCC only emits a non-hidden 'foo'.<br>
><br>
> ```<br>
> // RUN: g++ -std=c++11 -shared -O3 test.cpp && sym_extract.py a.out<br>
> // RUN: clang++ -std=c++11 -shared -O3 test.cpp && sym_extract.py a.out<br>
> #define INLINE_VISIBILITY __attribute__((visibility("<wbr>hidden"), always_inline))<br>
><br>
> template <class T><br>
> struct Foo {<br>
>  void foo();<br>
>  void bar();<br>
> };<br>
><br>
> template <class T><br>
> void Foo<T>::foo() {}<br>
><br>
> template <class T><br>
> inline INLINE_VISIBILITY<br>
> void Foo<T>::bar() {}<br>
><br>
> template struct Foo<int>;<br>
> ```<br>
><br>
> This difference creates ABI incompatibilities between Clang and GCC built dylibs. Specifically GCC built dylibs lack definitions for various member functions of `basic_string`, `basic_istream`, `basic_ostream`, `basic_iostream`, and `basic_streambuf` (All of these types are externally instantiated).<br>
><br>
> Surprisingly these missing symbols don't cause many problems because the functions are marked `always_inline`  therefore the dylib definition is rarely needed. However when an out-of-line definition is required then GCC built dylibs will fail to link. For example [GCC built dylibs cannot build Clang](<a href="http://stackoverflow.com/questions/39454262/clang-build-errors" rel="noreferrer" target="_blank">http://stackoverflow.<wbr>com/questions/39454262/clang-<wbr>build-errors</a>).<br>
><br>
> This patch works around this issue by adding `_LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY` which is used to mark externally instantiated member functions as always inline. When building the library `_LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY` sets the symbol's visibility to "default" instead of "hidden", otherwise it acts exactly the same as `_LIBCPP_INLINE_VISIBILITY`.<br>
><br>
> After applying this patch GCC dylibs now contain:<br>
>  * `_ZNSt3__115basic_<wbr>streambufIcNS_11char_<wbr>traitsIcEEE7sungetcEv`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIwNS_11char_<wbr>traitsIwEEE5gbumpEi`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIwNS_11char_<wbr>traitsIwEEE7sungetcEv`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIcNS_11char_<wbr>traitsIcEEE9sputbackcEc`<br>
>  * `_ZNSt3__113basic_istreamIwNS_<wbr>11char_traitsIwEEE3getERNS_<wbr>15basic_streambufIwS2_EE`<br>
>  * `_ZNSt3__113basic_ostreamIwNS_<wbr>11char_traitsIwEEElsEPFRNS_<wbr>9basic_iosIwS2_EES6_E`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIcNS_11char_<wbr>traitsIcEEE4setpEPcS4_`<br>
>  * `_ZNSt3__113basic_ostreamIwNS_<wbr>11char_traitsIwEEEC1EPNS_<wbr>15basic_streambufIwS2_EE`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIcNS_11char_<wbr>traitsIcEEE6snextcEv`<br>
>  * `_ZNSt3__113basic_istreamIcNS_<wbr>11char_traitsIcEEE4swapERS3_`<br>
>  * `_ZNSt3__113basic_istreamIwNS_<wbr>11char_traitsIwEEE4swapERS3_`<br>
>  * `_ZNSt3__112basic_stringIcNS_<wbr>11char_traitsIcEENS_<wbr>9allocatorIcEEE6__initEPKcm`<br>
>  * `_ZNSt3__113basic_istreamIcNS_<wbr>11char_traitsIcEEErsEPFRNS_<wbr>8ios_baseES5_E`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIcNS_11char_<wbr>traitsIcEEE9pubsetbufEPcl`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIcNS_11char_<wbr>traitsIcEEE10pubseekoffExNS_<wbr>8ios_base7seekdirEj`<br>
>  * `_ZNSt3__113basic_istreamIwNS_<wbr>11char_traitsIwEEErsEPFRNS_<wbr>9basic_iosIwS2_EES6_E`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIwNS_11char_<wbr>traitsIwEEE5pbumpEi`<br>
>  * `_ZNSt3__113basic_ostreamIcNS_<wbr>11char_traitsIcEEE5seekpENS_<wbr>4fposI11__mbstate_tEE`<br>
>  * `_ZNSt3__113basic_istreamIcNS_<wbr>11char_<wbr>traitsIcEEE7getlineEPcl`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIcNS_11char_<wbr>traitsIcEEE5sgetcEv`<br>
>  * `_ZNSt3__113basic_istreamIcNS_<wbr>11char_traitsIcEEE3getERNS_<wbr>15basic_streambufIcS2_EE`<br>
>  * `_ZNSt3__113basic_ostreamIcNS_<wbr>11char_traitsIcEEElsEPFRNS_<wbr>8ios_baseES5_E`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIcNS_11char_<wbr>traitsIcEEE8in_availEv`<br>
>  * `_ZNSt3__113basic_istreamIwNS_<wbr>11char_traitsIwEEErsEPFRNS_<wbr>8ios_baseES5_E`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIcNS_11char_<wbr>traitsIcEEE6sbumpcEv`<br>
>  * `_ZNSt3__113basic_ostreamIcNS_<wbr>11char_traitsIcEEElsEPFRNS_<wbr>9basic_iosIcS2_EES6_E`<br>
>  * `_ZNSt3__113basic_istreamIcNS_<wbr>11char_traitsIcEEE3getERc`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIwNS_11char_<wbr>traitsIwEEE6snextcEv`<br>
>  * `_ZNSt3__112basic_stringIwNS_<wbr>11char_traitsIwEENS_<wbr>9allocatorIwEEE6__initEmw`<br>
>  * `_ZNSt3__113basic_istreamIwNS_<wbr>11char_<wbr>traitsIwEEE7getlineEPwl`<br>
>  * `_ZNSt3__113basic_ostreamIcNS_<wbr>11char_traitsIcEEE5tellpEv`<br>
>  * `_ZNSt3__113basic_istreamIwNS_<wbr>11char_traitsIwEEE3getERw`<br>
>  * `_ZNSt3__112basic_stringIcNS_<wbr>11char_traitsIcEENS_<wbr>9allocatorIcEEE6__initEmc`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIcNS_11char_<wbr>traitsIcEEE7pubsyncEv`<br>
>  * `_ZNSt3__113basic_istreamIcNS_<wbr>11char_traitsIcEEE3getEPcl`<br>
>  * `_ZNSt3__113basic_istreamIcNS_<wbr>11char_traitsIcEEEC2EPNS_<wbr>15basic_streambufIcS2_EE`<br>
>  * `_ZNSt3__113basic_istreamIcNS_<wbr>11char_traitsIcEEErsEPFRNS_<wbr>9basic_iosIcS2_EES6_E`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIwNS_11char_<wbr>traitsIwEEE7pubsyncEv`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIcNS_11char_<wbr>traitsIcEEE5sputcEc`<br>
>  * `_ZNSt3__113basic_ostreamIwNS_<wbr>11char_traitsIwEEE5seekpExNS_<wbr>8ios_base7seekdirE`<br>
>  * `_ZNKSt3__115basic_<wbr>streambufIcNS_11char_<wbr>traitsIcEEE6getlocEv`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIcNS_11char_<wbr>traitsIcEEE5gbumpEi`<br>
>  * `_ZNSt3__114basic_<wbr>iostreamIcNS_11char_<wbr>traitsIcEEE4swapERS3_`<br>
>  * `_ZNSt3__113basic_ostreamIwNS_<wbr>11char_traitsIwEEE5seekpENS_<wbr>4fposI11__mbstate_tEE`<br>
>  * `_ZNSt3__113basic_ostreamIwNS_<wbr>11char_traitsIwEEE5tellpEv`<br>
>  * `_ZNSt3__113basic_ostreamIwNS_<wbr>11char_traitsIwEEElsEPFRS3_S4_<wbr>E`<br>
>  * `_ZNSt3__113basic_istreamIwNS_<wbr>11char_traitsIwEEE3getEPwl`<br>
>  * `_ZNSt3__113basic_istreamIwNS_<wbr>11char_traitsIwEEEC2EPNS_<wbr>15basic_streambufIwS2_EE`<br>
>  * `_ZNSt3__113basic_ostreamIcNS_<wbr>11char_traitsIcEEElsEPFRS3_S4_<wbr>E`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIcNS_11char_<wbr>traitsIcEEE4setgEPcS4_S4_`<br>
>  * `_ZNSt3__112basic_stringIwNS_<wbr>11char_traitsIwEENS_<wbr>9allocatorIwEEE6__initEPKwmm`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIwNS_11char_<wbr>traitsIwEEE4setgEPwS4_S4_`<br>
>  * `_ZNSt3__113basic_istreamIwNS_<wbr>11char_traitsIwEEEC1EPNS_<wbr>15basic_streambufIwS2_EE`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIcNS_11char_<wbr>traitsIcEEE8pubimbueERKNS_<wbr>6localeE`<br>
>  * `_ZNSt3__113basic_ostreamIcNS_<wbr>11char_traitsIcEEE4swapERS3_`<br>
>  * `_ZNSt3__113basic_ostreamIwNS_<wbr>11char_traitsIwEEEC2EPNS_<wbr>15basic_streambufIwS2_EE`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIwNS_11char_<wbr>traitsIwEEE10pubseekposENS_<wbr>4fposI11__mbstate_tEEj`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIcNS_11char_<wbr>traitsIcEEE5pbumpEi`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIwNS_11char_<wbr>traitsIwEEE5sgetcEv`<br>
>  * `_ZNSt3__113basic_ostreamIwNS_<wbr>11char_traitsIwEEE4swapERS3_`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIcNS_11char_<wbr>traitsIcEEE10pubseekposENS_<wbr>4fposI11__mbstate_tEEj`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIcNS_11char_<wbr>traitsIcEEE5sputnEPKcl`<br>
>  * `_ZNSt3__113basic_ostreamIcNS_<wbr>11char_traitsIcEEE5seekpExNS_<wbr>8ios_base7seekdirE`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIwNS_11char_<wbr>traitsIwEEE5sgetnEPwl`<br>
>  * `_ZNSt3__113basic_ostreamIwNS_<wbr>11char_traitsIwEEElsEPFRNS_<wbr>8ios_baseES5_E`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIwNS_11char_<wbr>traitsIwEEE4setpEPwS4_`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIcNS_11char_<wbr>traitsIcEEE5sgetnEPcl`<br>
>  * `_ZNKSt3__115basic_<wbr>streambufIwNS_11char_<wbr>traitsIwEEE6getlocEv`<br>
>  * `_ZNSt3__114basic_<wbr>iostreamIcNS_11char_<wbr>traitsIcEEEC2EPNS_15basic_<wbr>streambufIcS2_EE`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIwNS_11char_<wbr>traitsIwEEE8pubimbueERKNS_<wbr>6localeE`<br>
>  * `_ZNSt3__114basic_<wbr>iostreamIcNS_11char_<wbr>traitsIcEEEC1EPNS_15basic_<wbr>streambufIcS2_EE`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIwNS_11char_<wbr>traitsIwEEE8in_availEv`<br>
>  * `_ZNSt3__113basic_istreamIcNS_<wbr>11char_traitsIcEEEC1EPNS_<wbr>15basic_streambufIcS2_EE`<br>
>  * `_ZNSt3__112basic_stringIcNS_<wbr>11char_traitsIcEENS_<wbr>9allocatorIcEEE6__initEPKcmm`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIwNS_11char_<wbr>traitsIwEEE6sbumpcEv`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIwNS_11char_<wbr>traitsIwEEE10pubseekoffExNS_<wbr>8ios_base7seekdirEj`<br>
>  * `_ZNSt3__113basic_ostreamIcNS_<wbr>11char_traitsIcEEEC2EPNS_<wbr>15basic_streambufIcS2_EE`<br>
>  * `_ZNSt3__113basic_istreamIwNS_<wbr>11char_traitsIwEEErsEPFRS3_S4_<wbr>E`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIwNS_11char_<wbr>traitsIwEEE9sputbackcEw`<br>
>  * `_ZNSt3__112basic_stringIwNS_<wbr>11char_traitsIwEENS_<wbr>9allocatorIwEEE6__initEPKwm`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIwNS_11char_<wbr>traitsIwEEE5sputnEPKwl`<br>
>  * `_ZNSt3__113basic_istreamIcNS_<wbr>11char_traitsIcEEErsEPFRS3_S4_<wbr>E`<br>
>  * `_ZNSt3__113basic_ostreamIcNS_<wbr>11char_traitsIcEEEC1EPNS_<wbr>15basic_streambufIcS2_EE`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIwNS_11char_<wbr>traitsIwEEE9pubsetbufEPwl`<br>
>  * `_ZNSt3__115basic_<wbr>streambufIwNS_11char_<wbr>traitsIwEEE5sputcEw`<br>
><br>
><br>
> This patch has no effect on Clang based builds.<br>
><br>
><br>
><br>
> Reviewers: mclow.lists, eugenis, danalbert, jroelofs, EricWF<br>
><br>
> Subscribers: beanz, cfe-commits, mgorny<br>
><br>
> Differential Revision: <a href="https://reviews.llvm.org/D24600" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D24600</a><br>
><br>
> Modified:<br>
>    libcxx/trunk/CMakeLists.txt<br>
>    libcxx/trunk/docs/DesignDocs/<wbr>VisibilityMacros.rst<br>
>    libcxx/trunk/include/__config<br>
>    libcxx/trunk/include/istream<br>
>    libcxx/trunk/include/ostream<br>
>    libcxx/trunk/include/streambuf<br>
>    libcxx/trunk/include/string<br>
>    libcxx/trunk/utils/sym_check/<wbr>sym_diff.py<br>
><br>
> Modified: libcxx/trunk/CMakeLists.txt<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=281681&r1=281680&r2=281681&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/<wbr>CMakeLists.txt?rev=281681&r1=<wbr>281680&r2=281681&view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- libcxx/trunk/CMakeLists.txt (original)<br>
> +++ libcxx/trunk/CMakeLists.txt Thu Sep 15 19:00:48 2016<br>
> @@ -330,6 +330,8 @@ endif()<br>
> # headers<br>
> add_compile_flags_if_<wbr>supported(-nostdinc++)<br>
><br>
> +add_definitions(-D_LIBCPP_<wbr>BUILDING_LIBRARY)<br>
> +<br>
> # Warning flags ==============================<wbr>==============================<wbr>===<br>
> add_definitions(-D_LIBCPP_HAS_<wbr>NO_PRAGMA_SYSTEM_HEADER)<br>
> add_compile_flags_if_<wbr>supported(<br>
><br>
> Modified: libcxx/trunk/docs/DesignDocs/<wbr>VisibilityMacros.rst<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst?rev=281681&r1=281680&r2=281681&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/docs/<wbr>DesignDocs/VisibilityMacros.<wbr>rst?rev=281681&r1=281680&r2=<wbr>281681&view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- libcxx/trunk/docs/DesignDocs/<wbr>VisibilityMacros.rst (original)<br>
> +++ libcxx/trunk/docs/DesignDocs/<wbr>VisibilityMacros.rst Thu Sep 15 19:00:48 2016<br>
> @@ -71,6 +71,16 @@ Visibility Macros<br>
>   However since `_LIBCPP_TYPE_VIS_ONLY` is the same as `_LIBCPP_TYPE_VIS` the<br>
>   visibility is already correct. The macro has an empty definition with GCC.<br>
><br>
> +**_LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY**<br>
> +  Mark a member function of a class template as hidden and inline except when<br>
> +  building the libc++ library where it marks the symbol as being exported by<br>
> +  the library.<br>
> +<br>
> +  This macro is used to maintain ABI compatibility for symbols that have been<br>
> +  historically exported by the libc++ library but are now marked inline. It<br>
> +  should only be applied to member functions of class templates that are<br>
> +  externally instantiated.<br>
> +<br>
> **_LIBCPP_EXCEPTION_ABI**<br>
>   Mark the member functions, typeinfo, and vtable of the type as being exported<br>
>   by the libc++ library. This macro must be applied to all *exception types*.<br>
><br>
> Modified: libcxx/trunk/include/__config<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=281681&r1=281680&r2=281681&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/include/_<wbr>_config?rev=281681&r1=281680&<wbr>r2=281681&view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- libcxx/trunk/include/__config (original)<br>
> +++ libcxx/trunk/include/__config Thu Sep 15 19:00:48 2016<br>
> @@ -562,6 +562,7 @@ namespace std {<br>
> #define _LIBCPP_ENUM_VIS<br>
> #define _LIBCPP_INLINE_VISIBILITY __forceinline<br>
> #define _LIBCPP_ALWAYS_INLINE     __forceinline<br>
> +#define _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY __forceinline<br>
> #endif // _WIN32<br>
><br>
> #ifndef _LIBCPP_HIDDEN<br>
> @@ -616,6 +617,14 @@ namespace std {<br>
> #define _LIBCPP_ALWAYS_INLINE  __attribute__ ((__visibility__("hidden"), __always_inline__))<br>
> #endif<br>
><br>
> +#ifndef _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +# ifdef _LIBCPP_BUILDING_LIBRARY<br>
> +#   define _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY __attribute__((__visibility__(<wbr>"default"), __always_inline__))<br>
> +# else<br>
> +#   define _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY<br>
> +# endif<br>
> +#endif<br>
> +<br>
> #ifndef _LIBCPP_PREFERRED_OVERLOAD<br>
> #  if __has_attribute(__enable_if__)<br>
> #    define _LIBCPP_PREFERRED_OVERLOAD __attribute__ ((__enable_if__(true, "")))<br>
><br>
> Modified: libcxx/trunk/include/istream<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/istream?rev=281681&r1=281680&r2=281681&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/include/<wbr>istream?rev=281681&r1=281680&<wbr>r2=281681&view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- libcxx/trunk/include/istream (original)<br>
> +++ libcxx/trunk/include/istream Thu Sep 15 19:00:48 2016<br>
> @@ -184,19 +184,26 @@ public:<br>
>     typedef typename traits_type::off_type off_type;<br>
><br>
>     // 27.7.1.1.1 Constructor/destructor:<br>
> -    explicit basic_istream(basic_streambuf<<wbr>char_type, traits_type>* __sb);<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    explicit basic_istream(basic_streambuf<<wbr>char_type, traits_type>* __sb) : __gc_(0)<br>
> +    { this->init(__sb); }<br>
>     virtual ~basic_istream();<br>
> protected:<br>
> #ifndef _LIBCPP_HAS_NO_RVALUE_<wbr>REFERENCES<br>
> -    _LIBCPP_INLINE_VISIBILITY<br>
> +    inline _LIBCPP_INLINE_VISIBILITY<br>
>     basic_istream(basic_istream&& __rhs);<br>
> #endif<br>
>     // 27.7.1.1.2 Assign/swap:<br>
> #ifndef _LIBCPP_HAS_NO_RVALUE_<wbr>REFERENCES<br>
> -    _LIBCPP_INLINE_VISIBILITY<br>
> +    inline _LIBCPP_INLINE_VISIBILITY<br>
>     basic_istream& operator=(basic_istream&& __rhs);<br>
> #endif<br>
> -    void swap(basic_istream& __rhs);<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    void swap(basic_istream& __rhs) {<br>
> +      _VSTD::swap(__gc_, __rhs.__gc_);<br>
> +      basic_ios<char_type, traits_type>::swap(__rhs);<br>
> +    }<br>
><br>
> #if _LIBCPP_STD_VER > 11<br>
> #ifndef _LIBCPP_HAS_NO_DELETED_<wbr>FUNCTIONS<br>
> @@ -213,10 +220,19 @@ public:<br>
>     class _LIBCPP_TYPE_VIS_ONLY sentry;<br>
><br>
>     // 27.7.1.2 Formatted input:<br>
> -    basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&));<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&))<br>
> +    { return __pf(*this); }<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
>     basic_istream& operator>>(basic_ios<char_<wbr>type, traits_type>&<br>
> -                              (*__pf)(basic_ios<char_type, traits_type>&));<br>
> -    basic_istream& operator>>(ios_base& (*__pf)(ios_base&));<br>
> +                              (*__pf)(basic_ios<char_type, traits_type>&))<br>
> +    { __pf(*this); return *this; }<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    basic_istream& operator>>(ios_base& (*__pf)(ios_base&))<br>
> +    { __pf(*this); return *this; }<br>
> +<br>
>     basic_istream& operator>>(basic_streambuf<<wbr>char_type, traits_type>* __sb);<br>
>     basic_istream& operator>>(bool& __n);<br>
>     basic_istream& operator>>(short& __n);<br>
> @@ -236,13 +252,31 @@ public:<br>
>     _LIBCPP_INLINE_VISIBILITY<br>
>     streamsize gcount() const {return __gc_;}<br>
>     int_type get();<br>
> -    basic_istream& get(char_type& __c);<br>
> -    basic_istream& get(char_type* __s, streamsize __n);<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    basic_istream& get(char_type& __c) {<br>
> +      int_type __ch = get();<br>
> +      if (__ch != traits_type::eof())<br>
> +        __c = traits_type::to_char_type(__<wbr>ch);<br>
> +      return *this;<br>
> +    }<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    basic_istream& get(char_type* __s, streamsize __n)<br>
> +    { return get(__s, __n, this->widen('\n')); }<br>
> +<br>
>     basic_istream& get(char_type* __s, streamsize __n, char_type __dlm);<br>
> -    basic_istream& get(basic_streambuf<char_type, traits_type>& __sb);<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    basic_istream& get(basic_streambuf<char_type, traits_type>& __sb)<br>
> +    { return get(__sb, this->widen('\n')); }<br>
> +<br>
>     basic_istream& get(basic_streambuf<char_type, traits_type>& __sb, char_type __dlm);<br>
><br>
> -    basic_istream& getline(char_type* __s, streamsize __n);<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    basic_istream& getline(char_type* __s, streamsize __n)<br>
> +    { return getline(__s, __n, this->widen('\n')); }<br>
> +<br>
>     basic_istream& getline(char_type* __s, streamsize __n, char_type __dlm);<br>
><br>
>     basic_istream& ignore(streamsize __n = 1, int_type __dlm = traits_type::eof());<br>
> @@ -303,18 +337,9 @@ basic_istream<_CharT, _Traits>::sentry::<br>
>         __is.setstate(ios_base::<wbr>failbit);<br>
> }<br>
><br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -basic_istream<_CharT, _Traits>::basic_istream(basic_<wbr>streambuf<char_type, traits_type>* __sb)<br>
> -    : __gc_(0)<br>
> -{<br>
> -    this->init(__sb);<br>
> -}<br>
> -<br>
> #ifndef _LIBCPP_HAS_NO_RVALUE_<wbr>REFERENCES<br>
><br>
> template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> basic_istream<_CharT, _Traits>::basic_istream(basic_<wbr>istream&& __rhs)<br>
>     : __gc_(__rhs.__gc_)<br>
> {<br>
> @@ -323,7 +348,6 @@ basic_istream<_CharT, _Traits>::basic_is<br>
> }<br>
><br>
> template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> basic_istream<_CharT, _Traits>&<br>
> basic_istream<_CharT, _Traits>::operator=(basic_<wbr>istream&& __rhs)<br>
> {<br>
> @@ -339,15 +363,6 @@ basic_istream<_CharT, _Traits>::~basic_i<br>
> }<br>
><br>
> template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -void<br>
> -basic_istream<_CharT, _Traits>::swap(basic_istream& __rhs)<br>
> -{<br>
> -    _VSTD::swap(__gc_, __rhs.__gc_);<br>
> -    basic_ios<char_type, traits_type>::swap(__rhs);<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> basic_istream<_CharT, _Traits>&<br>
> basic_istream<_CharT, _Traits>::operator>>(unsigned short& __n)<br>
> {<br>
> @@ -724,33 +739,6 @@ basic_istream<_CharT, _Traits>::operator<br>
>     return *this;<br>
> }<br>
><br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -basic_istream<_CharT, _Traits>&<br>
> -basic_istream<_CharT, _Traits>::operator>>(basic_<wbr>istream& (*__pf)(basic_istream&))<br>
> -{<br>
> -    return __pf(*this);<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -basic_istream<_CharT, _Traits>&<br>
> -basic_istream<_CharT, _Traits>::operator>>(basic_<wbr>ios<char_type, traits_type>&<br>
> -                                           (*__pf)(basic_ios<char_type, traits_type>&))<br>
> -{<br>
> -    __pf(*this);<br>
> -    return *this;<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -basic_istream<_CharT, _Traits>&<br>
> -basic_istream<_CharT, _Traits>::operator>>(ios_base& (*__pf)(ios_base&))<br>
> -{<br>
> -    __pf(*this);<br>
> -    return *this;<br>
> -}<br>
> -<br>
> template<class _CharT, class _Traits><br>
> basic_istream<_CharT, _Traits>&<br>
> operator>>(basic_istream<_<wbr>CharT, _Traits>& __is, _CharT* __s)<br>
> @@ -947,17 +935,6 @@ basic_istream<_CharT, _Traits>::get()<br>
> }<br>
><br>
> template<class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -basic_istream<_CharT, _Traits>&<br>
> -basic_istream<_CharT, _Traits>::get(char_type& __c)<br>
> -{<br>
> -    int_type __ch = get();<br>
> -    if (__ch != traits_type::eof())<br>
> -        __c = traits_type::to_char_type(__<wbr>ch);<br>
> -    return *this;<br>
> -}<br>
> -<br>
> -template<class _CharT, class _Traits><br>
> basic_istream<_CharT, _Traits>&<br>
> basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __dlm)<br>
> {<br>
> @@ -1006,14 +983,6 @@ basic_istream<_CharT, _Traits>::get(char<br>
> }<br>
><br>
> template<class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -basic_istream<_CharT, _Traits>&<br>
> -basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n)<br>
> -{<br>
> -    return get(__s, __n, this->widen('\n'));<br>
> -}<br>
> -<br>
> -template<class _CharT, class _Traits><br>
> basic_istream<_CharT, _Traits>&<br>
> basic_istream<_CharT, _Traits>::get(basic_streambuf<<wbr>char_type, traits_type>& __sb,<br>
>                                     char_type __dlm)<br>
> @@ -1068,14 +1037,6 @@ basic_istream<_CharT, _Traits>::get(basi<br>
> }<br>
><br>
> template<class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -basic_istream<_CharT, _Traits>&<br>
> -basic_istream<_CharT, _Traits>::get(basic_streambuf<<wbr>char_type, traits_type>& __sb)<br>
> -{<br>
> -    return get(__sb, this->widen('\n'));<br>
> -}<br>
> -<br>
> -template<class _CharT, class _Traits><br>
> basic_istream<_CharT, _Traits>&<br>
> basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_type __dlm)<br>
> {<br>
> @@ -1129,14 +1090,6 @@ basic_istream<_CharT, _Traits>::getline(<br>
> }<br>
><br>
> template<class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -basic_istream<_CharT, _Traits>&<br>
> -basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n)<br>
> -{<br>
> -    return getline(__s, __n, this->widen('\n'));<br>
> -}<br>
> -<br>
> -template<class _CharT, class _Traits><br>
> basic_istream<_CharT, _Traits>&<br>
> basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm)<br>
> {<br>
> @@ -1503,41 +1456,38 @@ public:<br>
>     typedef typename traits_type::off_type off_type;<br>
><br>
>     // constructor/destructor<br>
> -    explicit basic_iostream(basic_<wbr>streambuf<char_type, traits_type>* __sb);<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    explicit basic_iostream(basic_<wbr>streambuf<char_type, traits_type>* __sb)<br>
> +      : basic_istream<_CharT, _Traits>(__sb)<br>
> +    {}<br>
> +<br>
>     virtual ~basic_iostream();<br>
> protected:<br>
> #ifndef _LIBCPP_HAS_NO_RVALUE_<wbr>REFERENCES<br>
> -    _LIBCPP_INLINE_VISIBILITY<br>
> +    inline _LIBCPP_INLINE_VISIBILITY<br>
>     basic_iostream(basic_iostream&<wbr>& __rhs);<br>
> #endif<br>
><br>
>     // assign/swap<br>
> #ifndef _LIBCPP_HAS_NO_RVALUE_<wbr>REFERENCES<br>
> -    _LIBCPP_INLINE_VISIBILITY<br>
> +    inline _LIBCPP_INLINE_VISIBILITY<br>
>     basic_iostream& operator=(basic_iostream&& __rhs);<br>
> #endif<br>
> -    void swap(basic_iostream& __rhs);<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    void swap(basic_iostream& __rhs)<br>
> +    { basic_istream<char_type, traits_type>::swap(__rhs); }<br>
> public:<br>
> };<br>
><br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -basic_iostream<_CharT, _Traits>::basic_iostream(<wbr>basic_streambuf<char_type, traits_type>* __sb)<br>
> -    : basic_istream<_CharT, _Traits>(__sb)<br>
> -{<br>
> -}<br>
> -<br>
> #ifndef _LIBCPP_HAS_NO_RVALUE_<wbr>REFERENCES<br>
><br>
> template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> basic_iostream<_CharT, _Traits>::basic_iostream(<wbr>basic_iostream&& __rhs)<br>
>     : basic_istream<_CharT, _Traits>(_VSTD::move(__rhs))<br>
> {<br>
> }<br>
><br>
> template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> basic_iostream<_CharT, _Traits>&<br>
> basic_iostream<_CharT, _Traits>::operator=(basic_<wbr>iostream&& __rhs)<br>
> {<br>
> @@ -1552,14 +1502,6 @@ basic_iostream<_CharT, _Traits>::~basic_<br>
> {<br>
> }<br>
><br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -void<br>
> -basic_iostream<_CharT, _Traits>::swap(basic_iostream& __rhs)<br>
> -{<br>
> -    basic_istream<char_type, traits_type>::swap(__rhs);<br>
> -}<br>
> -<br>
> template<class _CharT, class _Traits, class _Allocator><br>
> basic_istream<_CharT, _Traits>&<br>
> operator>>(basic_istream<_<wbr>CharT, _Traits>& __is,<br>
><br>
> Modified: libcxx/trunk/include/ostream<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/ostream?rev=281681&r1=281680&r2=281681&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/include/<wbr>ostream?rev=281681&r1=281680&<wbr>r2=281681&view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- libcxx/trunk/include/ostream (original)<br>
> +++ libcxx/trunk/include/ostream Thu Sep 15 19:00:48 2016<br>
> @@ -160,20 +160,24 @@ public:<br>
>     typedef typename traits_type::off_type off_type;<br>
><br>
>     // 27.7.2.2 Constructor/destructor:<br>
> -    explicit basic_ostream(basic_streambuf<<wbr>char_type, traits_type>* __sb);<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    explicit basic_ostream(basic_streambuf<<wbr>char_type, traits_type>* __sb)<br>
> +    { this->init(__sb); }<br>
>     virtual ~basic_ostream();<br>
> protected:<br>
> #ifndef _LIBCPP_HAS_NO_RVALUE_<wbr>REFERENCES<br>
> -    _LIBCPP_INLINE_VISIBILITY<br>
> +    inline _LIBCPP_INLINE_VISIBILITY<br>
>     basic_ostream(basic_ostream&& __rhs);<br>
> #endif<br>
><br>
>     // 27.7.2.3 Assign/swap<br>
> #ifndef _LIBCPP_HAS_NO_RVALUE_<wbr>REFERENCES<br>
> -    _LIBCPP_INLINE_VISIBILITY<br>
> +    inline _LIBCPP_INLINE_VISIBILITY<br>
>     basic_ostream& operator=(basic_ostream&& __rhs);<br>
> #endif<br>
> -    void swap(basic_ostream& __rhs);<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    void swap(basic_ostream& __rhs)<br>
> +    { basic_ios<char_type, traits_type>::swap(__rhs); }<br>
><br>
> #ifndef _LIBCPP_HAS_NO_DELETED_<wbr>FUNCTIONS<br>
>     basic_ostream           (const basic_ostream& __rhs) = delete;<br>
> @@ -188,10 +192,19 @@ public:<br>
>     class _LIBCPP_TYPE_VIS_ONLY sentry;<br>
><br>
>     // 27.7.2.6 Formatted output:<br>
> -    basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&));<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&))<br>
> +    { return __pf(*this); }<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
>     basic_ostream& operator<<(basic_ios<char_<wbr>type, traits_type>&<br>
> -                              (*__pf)(basic_ios<char_type,<wbr>traits_type>&));<br>
> -    basic_ostream& operator<<(ios_base& (*__pf)(ios_base&));<br>
> +                              (*__pf)(basic_ios<char_type,<wbr>traits_type>&))<br>
> +    { __pf(*this); return *this; }<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    basic_ostream& operator<<(ios_base& (*__pf)(ios_base&))<br>
> +    { __pf(*this); return *this; }<br>
> +<br>
>     basic_ostream& operator<<(bool __n);<br>
>     basic_ostream& operator<<(short __n);<br>
>     basic_ostream& operator<<(unsigned short __n);<br>
> @@ -213,8 +226,11 @@ public:<br>
>     basic_ostream& flush();<br>
><br>
>     // 27.7.2.5 seeks:<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
>     pos_type tellp();<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
>     basic_ostream& seekp(pos_type __pos);<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
>     basic_ostream& seekp(off_type __off, ios_base::seekdir __dir);<br>
><br>
> protected:<br>
> @@ -274,24 +290,15 @@ basic_ostream<_CharT, _Traits>::sentry::<br>
>     }<br>
> }<br>
><br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -basic_ostream<_CharT, _Traits>::basic_ostream(basic_<wbr>streambuf<char_type, traits_type>* __sb)<br>
> -{<br>
> -    this->init(__sb);<br>
> -}<br>
> -<br>
> #ifndef _LIBCPP_HAS_NO_RVALUE_<wbr>REFERENCES<br>
><br>
> template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> basic_ostream<_CharT, _Traits>::basic_ostream(basic_<wbr>ostream&& __rhs)<br>
> {<br>
>     this->move(__rhs);<br>
> }<br>
><br>
> template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> basic_ostream<_CharT, _Traits>&<br>
> basic_ostream<_CharT, _Traits>::operator=(basic_<wbr>ostream&& __rhs)<br>
> {<br>
> @@ -307,41 +314,6 @@ basic_ostream<_CharT, _Traits>::~basic_o<br>
> }<br>
><br>
> template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -void<br>
> -basic_ostream<_CharT, _Traits>::swap(basic_ostream& __rhs)<br>
> -{<br>
> -    basic_ios<char_type, traits_type>::swap(__rhs);<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -basic_ostream<_CharT, _Traits>&<br>
> -basic_ostream<_CharT, _Traits>::operator<<(basic_<wbr>ostream& (*__pf)(basic_ostream&))<br>
> -{<br>
> -    return __pf(*this);<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -basic_ostream<_CharT, _Traits>&<br>
> -basic_ostream<_CharT, _Traits>::operator<<(basic_<wbr>ios<char_type, traits_type>&<br>
> -                                           (*__pf)(basic_ios<char_type,<wbr>traits_type>&))<br>
> -{<br>
> -    __pf(*this);<br>
> -    return *this;<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -basic_ostream<_CharT, _Traits>&<br>
> -basic_ostream<_CharT, _Traits>::operator<<(ios_base& (*__pf)(ios_base&))<br>
> -{<br>
> -    __pf(*this);<br>
> -    return *this;<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> basic_ostream<_CharT, _Traits>&<br>
> basic_ostream<_CharT, _Traits>::operator<<(basic_<wbr>streambuf<char_type, traits_type>* __sb)<br>
> {<br>
> @@ -989,7 +961,6 @@ basic_ostream<_CharT, _Traits>::flush()<br>
> }<br>
><br>
> template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> typename basic_ostream<_CharT, _Traits>::pos_type<br>
> basic_ostream<_CharT, _Traits>::tellp()<br>
> {<br>
> @@ -999,7 +970,6 @@ basic_ostream<_CharT, _Traits>::tellp()<br>
> }<br>
><br>
> template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> basic_ostream<_CharT, _Traits>&<br>
> basic_ostream<_CharT, _Traits>::seekp(pos_type __pos)<br>
> {<br>
> @@ -1013,7 +983,6 @@ basic_ostream<_CharT, _Traits>::seekp(po<br>
> }<br>
><br>
> template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> basic_ostream<_CharT, _Traits>&<br>
> basic_ostream<_CharT, _Traits>::seekp(off_type __off, ios_base::seekdir __dir)<br>
> {<br>
><br>
> Modified: libcxx/trunk/include/streambuf<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/streambuf?rev=281681&r1=281680&r2=281681&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/include/<wbr>streambuf?rev=281681&r1=<wbr>281680&r2=281681&view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- libcxx/trunk/include/streambuf (original)<br>
> +++ libcxx/trunk/include/streambuf Thu Sep 15 19:00:48 2016<br>
> @@ -132,32 +132,96 @@ public:<br>
>     virtual ~basic_streambuf();<br>
><br>
>     // 27.6.2.2.1 locales:<br>
> -    locale pubimbue(const locale& __loc);<br>
> -    locale getloc() const;<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    locale pubimbue(const locale& __loc) {<br>
> +        imbue(__loc);<br>
> +        locale __r = __loc_;<br>
> +        __loc_ = __loc;<br>
> +        return __r;<br>
> +    }<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    locale getloc() const { return __loc_; }<br>
><br>
>     // 27.6.2.2.2 buffer and positioning:<br>
> -    basic_streambuf* pubsetbuf(char_type* __s, streamsize __n);<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    basic_streambuf* pubsetbuf(char_type* __s, streamsize __n)<br>
> +    { return setbuf(__s, __n); }<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
>     pos_type pubseekoff(off_type __off, ios_base::seekdir __way,<br>
> -                        ios_base::openmode __which = ios_base::in | ios_base::out);<br>
> +                        ios_base::openmode __which = ios_base::in | ios_base::out)<br>
> +    { return seekoff(__off, __way, __which); }<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
>     pos_type pubseekpos(pos_type __sp,<br>
> -                        ios_base::openmode __which = ios_base::in | ios_base::out);<br>
> -    int pubsync();<br>
> +                        ios_base::openmode __which = ios_base::in | ios_base::out)<br>
> +    { return seekpos(__sp, __which); }<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    int pubsync() { return sync(); }<br>
><br>
>     // Get and put areas:<br>
>     // 27.6.2.2.3 Get area:<br>
> -    streamsize in_avail();<br>
> -    int_type snextc();<br>
> -    int_type sbumpc();<br>
> -    int_type sgetc();<br>
> -    streamsize sgetn(char_type* __s, streamsize __n);<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    streamsize in_avail() {<br>
> +        if (__ninp_ < __einp_)<br>
> +            return static_cast<streamsize>(__<wbr>einp_ - __ninp_);<br>
> +        return showmanyc();<br>
> +    }<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    int_type snextc() {<br>
> +        if (sbumpc() == traits_type::eof())<br>
> +            return traits_type::eof();<br>
> +        return sgetc();<br>
> +    }<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    int_type sbumpc() {<br>
> +        if (__ninp_ == __einp_)<br>
> +            return uflow();<br>
> +        return traits_type::to_int_type(*__<wbr>ninp_++);<br>
> +    }<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    int_type sgetc() {<br>
> +        if (__ninp_ == __einp_)<br>
> +            return underflow();<br>
> +        return traits_type::to_int_type(*__<wbr>ninp_);<br>
> +    }<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    streamsize sgetn(char_type* __s, streamsize __n)<br>
> +    { return xsgetn(__s, __n); }<br>
><br>
>     // 27.6.2.2.4 Putback:<br>
> -    int_type sputbackc(char_type __c);<br>
> -    int_type sungetc();<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    int_type sputbackc(char_type __c) {<br>
> +        if (__binp_ == __ninp_ || !traits_type::eq(__c, __ninp_[-1]))<br>
> +            return pbackfail(traits_type::to_int_<wbr>type(__c));<br>
> +        return traits_type::to_int_type(*--__<wbr>ninp_);<br>
> +    }<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    int_type sungetc() {<br>
> +        if (__binp_ == __ninp_)<br>
> +          return pbackfail();<br>
> +        return traits_type::to_int_type(*--__<wbr>ninp_);<br>
> +    }<br>
><br>
>     // 27.6.2.2.5 Put area:<br>
> -    int_type sputc(char_type __c);<br>
> -    streamsize sputn(const char_type* __s, streamsize __n);<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    int_type sputc(char_type __c) {<br>
> +        if (__nout_ == __eout_)<br>
> +            return overflow(traits_type::to_int_<wbr>type(__c));<br>
> +        *__nout_++ = __c;<br>
> +        return traits_type::to_int_type(__c);<br>
> +    }<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    streamsize sputn(const char_type* __s, streamsize __n)<br>
> +    { return xsputn(__s, __n); }<br>
><br>
> protected:<br>
>     basic_streambuf();<br>
> @@ -169,15 +233,30 @@ protected:<br>
>     _LIBCPP_ALWAYS_INLINE char_type* eback() const {return __binp_;}<br>
>     _LIBCPP_ALWAYS_INLINE char_type* gptr()  const {return __ninp_;}<br>
>     _LIBCPP_ALWAYS_INLINE char_type* egptr() const {return __einp_;}<br>
> -    void gbump(int __n);<br>
> -    void setg(char_type* __gbeg, char_type* __gnext, char_type* __gend);<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    void gbump(int __n) { __ninp_ += __n; }<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    void setg(char_type* __gbeg, char_type* __gnext, char_type* __gend) {<br>
> +        __binp_ = __gbeg;<br>
> +        __ninp_ = __gnext;<br>
> +        __einp_ = __gend;<br>
> +    }<br>
><br>
>     // 27.6.2.3.3 Put area:<br>
>     _LIBCPP_ALWAYS_INLINE char_type* pbase() const {return __bout_;}<br>
>     _LIBCPP_ALWAYS_INLINE char_type* pptr()  const {return __nout_;}<br>
>     _LIBCPP_ALWAYS_INLINE char_type* epptr() const {return __eout_;}<br>
> -    void pbump(int __n);<br>
> -    void setp(char_type* __pbeg, char_type* __pend);<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    void pbump(int __n) { __nout_ += __n; }<br>
> +<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
> +    void setp(char_type* __pbeg, char_type* __pend) {<br>
> +        __bout_ = __nout_ = __pbeg;<br>
> +        __eout_ = __pend;<br>
> +    }<br>
><br>
>     // 27.6.2.4 virtual functions:<br>
>     // 27.6.2.4.1 Locales:<br>
> @@ -220,147 +299,6 @@ basic_streambuf<_CharT, _Traits>::~basic<br>
> }<br>
><br>
> template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -locale<br>
> -basic_streambuf<_CharT, _Traits>::pubimbue(const locale& __loc)<br>
> -{<br>
> -    imbue(__loc);<br>
> -    locale __r = __loc_;<br>
> -    __loc_ = __loc;<br>
> -    return __r;<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -locale<br>
> -basic_streambuf<_CharT, _Traits>::getloc() const<br>
> -{<br>
> -    return __loc_;<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -basic_streambuf<_CharT, _Traits>*<br>
> -basic_streambuf<_CharT, _Traits>::pubsetbuf(char_type* __s, streamsize __n)<br>
> -{<br>
> -    return setbuf(__s, __n);<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -typename basic_streambuf<_CharT, _Traits>::pos_type<br>
> -basic_streambuf<_CharT, _Traits>::pubseekoff(off_type __off,<br>
> -                                             ios_base::seekdir __way,<br>
> -                                             ios_base::openmode __which)<br>
> -{<br>
> -    return seekoff(__off, __way, __which);<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -typename basic_streambuf<_CharT, _Traits>::pos_type<br>
> -basic_streambuf<_CharT, _Traits>::pubseekpos(pos_type __sp,<br>
> -                                             ios_base::openmode __which)<br>
> -{<br>
> -    return seekpos(__sp, __which);<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -int<br>
> -basic_streambuf<_CharT, _Traits>::pubsync()<br>
> -{<br>
> -    return sync();<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -streamsize<br>
> -basic_streambuf<_CharT, _Traits>::in_avail()<br>
> -{<br>
> -    if (__ninp_ < __einp_)<br>
> -        return static_cast<streamsize>(__<wbr>einp_ - __ninp_);<br>
> -    return showmanyc();<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -typename basic_streambuf<_CharT, _Traits>::int_type<br>
> -basic_streambuf<_CharT, _Traits>::snextc()<br>
> -{<br>
> -    if (sbumpc() == traits_type::eof())<br>
> -        return traits_type::eof();<br>
> -    return sgetc();<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -typename basic_streambuf<_CharT, _Traits>::int_type<br>
> -basic_streambuf<_CharT, _Traits>::sbumpc()<br>
> -{<br>
> -    if (__ninp_ == __einp_)<br>
> -        return uflow();<br>
> -    return traits_type::to_int_type(*__<wbr>ninp_++);<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -typename basic_streambuf<_CharT, _Traits>::int_type<br>
> -basic_streambuf<_CharT, _Traits>::sgetc()<br>
> -{<br>
> -    if (__ninp_ == __einp_)<br>
> -        return underflow();<br>
> -    return traits_type::to_int_type(*__<wbr>ninp_);<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -streamsize<br>
> -basic_streambuf<_CharT, _Traits>::sgetn(char_type* __s, streamsize __n)<br>
> -{<br>
> -    return xsgetn(__s, __n);<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -typename basic_streambuf<_CharT, _Traits>::int_type<br>
> -basic_streambuf<_CharT, _Traits>::sputbackc(char_type __c)<br>
> -{<br>
> -    if (__binp_ == __ninp_ || !traits_type::eq(__c, __ninp_[-1]))<br>
> -        return pbackfail(traits_type::to_int_<wbr>type(__c));<br>
> -    return traits_type::to_int_type(*--__<wbr>ninp_);<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -typename basic_streambuf<_CharT, _Traits>::int_type<br>
> -basic_streambuf<_CharT, _Traits>::sungetc()<br>
> -{<br>
> -    if (__binp_ == __ninp_)<br>
> -        return pbackfail();<br>
> -    return traits_type::to_int_type(*--__<wbr>ninp_);<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -typename basic_streambuf<_CharT, _Traits>::int_type<br>
> -basic_streambuf<_CharT, _Traits>::sputc(char_type __c)<br>
> -{<br>
> -    if (__nout_ == __eout_)<br>
> -        return overflow(traits_type::to_int_<wbr>type(__c));<br>
> -    *__nout_++ = __c;<br>
> -    return traits_type::to_int_type(__c);<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -streamsize<br>
> -basic_streambuf<_CharT, _Traits>::sputn(const char_type* __s, streamsize __n)<br>
> -{<br>
> -    return xsputn(__s, __n);<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> basic_streambuf<_CharT, _Traits>::basic_streambuf()<br>
>     : __binp_(0),<br>
>       __ninp_(0),<br>
> @@ -411,42 +349,6 @@ basic_streambuf<_CharT, _Traits>::swap(b<br>
> }<br>
><br>
> template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -void<br>
> -basic_streambuf<_CharT, _Traits>::gbump(int __n)<br>
> -{<br>
> -    __ninp_ += __n;<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -void<br>
> -basic_streambuf<_CharT, _Traits>::setg(char_type* __gbeg, char_type* __gnext,<br>
> -                                                          char_type* __gend)<br>
> -{<br>
> -    __binp_ = __gbeg;<br>
> -    __ninp_ = __gnext;<br>
> -    __einp_ = __gend;<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -void<br>
> -basic_streambuf<_CharT, _Traits>::pbump(int __n)<br>
> -{<br>
> -    __nout_ += __n;<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -void<br>
> -basic_streambuf<_CharT, _Traits>::setp(char_type* __pbeg, char_type* __pend)<br>
> -{<br>
> -    __bout_ = __nout_ = __pbeg;<br>
> -    __eout_ = __pend;<br>
> -}<br>
> -<br>
> -template <class _CharT, class _Traits><br>
> void<br>
> basic_streambuf<_CharT, _Traits>::imbue(const locale&)<br>
> {<br>
><br>
> Modified: libcxx/trunk/include/string<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/string?rev=281681&r1=281680&r2=281681&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/include/<wbr>string?rev=281681&r1=281680&<wbr>r2=281681&view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- libcxx/trunk/include/string (original)<br>
> +++ libcxx/trunk/include/string Thu Sep 15 19:00:48 2016<br>
> @@ -1269,11 +1269,15 @@ private:<br>
>                  __align_it<sizeof(value_type) < __alignment ?<br>
>                             __alignment/sizeof(value_type) : 1 > (__s+1)) - 1;}<br>
><br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
>     void __init(const value_type* __s, size_type __sz, size_type __reserve);<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
>     void __init(const value_type* __s, size_type __sz);<br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
>     void __init(size_type __n, value_type __c);<br>
><br>
>     template <class _InputIterator><br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
>     typename enable_if<br>
>     <<br>
>         __is_exactly_input_iterator<_<wbr>InputIterator>::value,<br>
> @@ -1282,6 +1286,7 @@ private:<br>
>     __init(_InputIterator __first, _InputIterator __last);<br>
><br>
>     template <class _ForwardIterator><br>
> +    inline _LIBCPP_EXTERN_TEMPLATE_<wbr>INLINE_VISIBILITY<br>
>     typename enable_if<br>
>     <<br>
>         __is_forward_iterator<_<wbr>ForwardIterator>::value,<br>
> @@ -1430,9 +1435,9 @@ basic_string<_CharT, _Traits, _Allocator<br>
> }<br>
><br>
> template <class _CharT, class _Traits, class _Allocator><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> -void<br>
> -basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz, size_type __reserve)<br>
> +void basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s,<br>
> +                                                       size_type __sz,<br>
> +                                                       size_type __reserve)<br>
> {<br>
>     if (__reserve > max_size())<br>
>         this->__throw_length_error();<br>
> @@ -1455,7 +1460,6 @@ basic_string<_CharT, _Traits, _Allocator<br>
> }<br>
><br>
> template <class _CharT, class _Traits, class _Allocator><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> void<br>
> basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz)<br>
> {<br>
> @@ -1593,7 +1597,6 @@ basic_string<_CharT, _Traits, _Allocator<br>
> #endif  // _LIBCPP_HAS_NO_RVALUE_<wbr>REFERENCES<br>
><br>
> template <class _CharT, class _Traits, class _Allocator><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> void<br>
> basic_string<_CharT, _Traits, _Allocator>::__init(size_type __n, value_type __c)<br>
> {<br>
> @@ -1690,7 +1693,6 @@ basic_string<_CharT, _Traits, _Allocator<br>
><br>
> template <class _CharT, class _Traits, class _Allocator><br>
> template <class _InputIterator><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> typename enable_if<br>
> <<br>
>     __is_exactly_input_iterator<_<wbr>InputIterator>::value,<br>
> @@ -1718,7 +1720,6 @@ basic_string<_CharT, _Traits, _Allocator<br>
><br>
> template <class _CharT, class _Traits, class _Allocator><br>
> template <class _ForwardIterator><br>
> -inline _LIBCPP_INLINE_VISIBILITY<br>
> typename enable_if<br>
> <<br>
>     __is_forward_iterator<_<wbr>ForwardIterator>::value,<br>
><br>
> Modified: libcxx/trunk/utils/sym_check/<wbr>sym_diff.py<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/utils/sym_check/sym_diff.py?rev=281681&r1=281680&r2=281681&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/utils/<wbr>sym_check/sym_diff.py?rev=<wbr>281681&r1=281680&r2=281681&<wbr>view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- libcxx/trunk/utils/sym_check/<wbr>sym_diff.py (original)<br>
> +++ libcxx/trunk/utils/sym_check/<wbr>sym_diff.py Thu Sep 15 19:00:48 2016<br>
> @@ -24,6 +24,10 @@ def main():<br>
>         help='Only print symbol names',<br>
>         action='store_true', default=False)<br>
>     parser.add_argument(<br>
> +        '--removed-only', dest='removed_only',<br>
> +        help='Only print removed symbols',<br>
> +        action='store_true', default=False)<br>
> +    parser.add_argument(<br>
>         '-o', '--output', dest='output',<br>
>         help='The output file. stdout is used if not given',<br>
>         type=str, action='store', default=None)<br>
> @@ -41,6 +45,8 @@ def main():<br>
>     new_syms_list = util.extract_or_load(args.new_<wbr>syms)<br>
><br>
>     added, removed, changed = diff.diff(old_syms_list, new_syms_list)<br>
> +    if args.removed_only:<br>
> +        added = {}<br>
>     report, is_break = diff.report_diff(added, removed, changed,<br>
>                                         names_only=args.names_only,<br>
>                                         demangle=args.demangle)<br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
<br>
</div></div></blockquote></div><br></div></div>