<div dir="ltr">Hi Justin,<div><br></div><div>I'm not quite sure we are should do that right now. </div><div>If your compiling with MSAN and you call a function in an extern template MSAN will fire. </div><div><br></div>
<div>For example testing test/string with MSAN enabled causes 124 failures. Normally there are just 2.</div><div>We could probably guard the _LIBCPP_EXTERN_TEMPLATE definition to check for MSAN but for now I don't</div>
<div>think we are ready to re-enable external template definitions.</div><div><br></div><div>/Eric</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 15, 2014 at 11:58 AM, Justin Bogner <span dir="ltr"><<a href="mailto:mail@justinbogner.com" target="_blank">mail@justinbogner.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: bogner<br>
Date: Fri Aug 15 12:58:56 2014<br>
New Revision: 215740<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=215740&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=215740&view=rev</a><br>
Log:<br>
Revert "Turn off extern templates for most uses."<br>
<br>
Turning off explicit template instantiation leads to a pretty<br>
significant build time and code size cost. We're better off dealing<br>
with ABI incompatibility issues that come up in a less heavy handed<br>
way.<br>
<br>
This reverts commit r189610.<br>
<br>
Modified:<br>
    libcxx/trunk/include/__config<br>
    libcxx/trunk/src/algorithm.cpp<br>
    libcxx/trunk/src/ios.cpp<br>
    libcxx/trunk/src/locale.cpp<br>
    libcxx/trunk/src/string.cpp<br>
    libcxx/trunk/src/valarray.cpp<br>
<br>
Modified: libcxx/trunk/include/__config<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=215740&r1=215739&r2=215740&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=215740&r1=215739&r2=215740&view=diff</a><br>

==============================================================================<br>
--- libcxx/trunk/include/__config (original)<br>
+++ libcxx/trunk/include/__config Fri Aug 15 12:58:56 2014<br>
@@ -608,7 +608,7 @@ template <unsigned> struct __static_asse<br>
 #endif<br>
<br>
 #ifndef _LIBCPP_EXTERN_TEMPLATE<br>
-#define _LIBCPP_EXTERN_TEMPLATE(...)<br>
+#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;<br>
 #endif<br>
<br>
 #ifndef _LIBCPP_EXTERN_TEMPLATE2<br>
<br>
Modified: libcxx/trunk/src/algorithm.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/algorithm.cpp?rev=215740&r1=215739&r2=215740&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/algorithm.cpp?rev=215740&r1=215739&r2=215740&view=diff</a><br>

==============================================================================<br>
--- libcxx/trunk/src/algorithm.cpp (original)<br>
+++ libcxx/trunk/src/algorithm.cpp Fri Aug 15 12:58:56 2014<br>
@@ -7,7 +7,6 @@<br>
 //<br>
 //===----------------------------------------------------------------------===//<br>
<br>
-#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;<br>
 #include "algorithm"<br>
 #include "random"<br>
 #include "mutex"<br>
<br>
Modified: libcxx/trunk/src/ios.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/ios.cpp?rev=215740&r1=215739&r2=215740&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/ios.cpp?rev=215740&r1=215739&r2=215740&view=diff</a><br>

==============================================================================<br>
--- libcxx/trunk/src/ios.cpp (original)<br>
+++ libcxx/trunk/src/ios.cpp Fri Aug 15 12:58:56 2014<br>
@@ -7,8 +7,6 @@<br>
 //<br>
 //===----------------------------------------------------------------------===//<br>
<br>
-#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;<br>
-<br>
 #include "ios"<br>
 #include "streambuf"<br>
 #include "istream"<br>
<br>
Modified: libcxx/trunk/src/locale.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/locale.cpp?rev=215740&r1=215739&r2=215740&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/locale.cpp?rev=215740&r1=215739&r2=215740&view=diff</a><br>

==============================================================================<br>
--- libcxx/trunk/src/locale.cpp (original)<br>
+++ libcxx/trunk/src/locale.cpp Fri Aug 15 12:58:56 2014<br>
@@ -7,8 +7,6 @@<br>
 //<br>
 //===----------------------------------------------------------------------===//<br>
<br>
-#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;<br>
-<br>
 // On Solaris, we need to define something to make the C99 parts of localeconv<br>
 // visible.<br>
 #ifdef __sun__<br>
<br>
Modified: libcxx/trunk/src/string.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/string.cpp?rev=215740&r1=215739&r2=215740&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/string.cpp?rev=215740&r1=215739&r2=215740&view=diff</a><br>

==============================================================================<br>
--- libcxx/trunk/src/string.cpp (original)<br>
+++ libcxx/trunk/src/string.cpp Fri Aug 15 12:58:56 2014<br>
@@ -7,8 +7,6 @@<br>
 //<br>
 //===----------------------------------------------------------------------===//<br>
<br>
-#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;<br>
-<br>
 #include "string"<br>
 #include "cstdlib"<br>
 #include "cwchar"<br>
<br>
Modified: libcxx/trunk/src/valarray.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/valarray.cpp?rev=215740&r1=215739&r2=215740&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/valarray.cpp?rev=215740&r1=215739&r2=215740&view=diff</a><br>

==============================================================================<br>
--- libcxx/trunk/src/valarray.cpp (original)<br>
+++ libcxx/trunk/src/valarray.cpp Fri Aug 15 12:58:56 2014<br>
@@ -7,8 +7,6 @@<br>
 //<br>
 //===----------------------------------------------------------------------===//<br>
<br>
-#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;<br>
-<br>
 #include "valarray"<br>
<br>
 _LIBCPP_BEGIN_NAMESPACE_STD<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>