Move typeinfos for exceptions in <stdexcept> to the abi

llvm-svn: 150835
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: f95d9f0a3a87472e83ab893b90c42d25d7df54b1
diff --git a/lib/libc++abi2.exp b/lib/libc++abi2.exp
index 471c686..9d7a5e7 100644
--- a/lib/libc++abi2.exp
+++ b/lib/libc++abi2.exp
@@ -201,3 +201,68 @@
 __ZTISt8bad_cast
 ___cxa_bad_typeid
 ___cxa_bad_cast
+
+__ZNKSt11logic_error4whatEv
+__ZNSt11logic_errorD0Ev
+__ZNSt11logic_errorD1Ev
+__ZNSt11logic_errorD2Ev
+__ZTISt11logic_error
+__ZTSSt11logic_error
+__ZTVSt11logic_error
+
+__ZNKSt13runtime_error4whatEv
+__ZNSt13runtime_errorD0Ev
+__ZNSt13runtime_errorD1Ev
+__ZNSt13runtime_errorD2Ev
+__ZTISt13runtime_error
+__ZTSSt13runtime_error
+__ZTVSt13runtime_error
+
+__ZNSt11range_errorD0Ev
+__ZNSt11range_errorD1Ev
+__ZNSt11range_errorD2Ev
+__ZTISt11range_error
+__ZTSSt11range_error
+__ZTVSt11range_error
+
+__ZNSt12domain_errorD0Ev
+__ZNSt12domain_errorD1Ev
+__ZNSt12domain_errorD2Ev
+__ZTISt12domain_error
+__ZTSSt12domain_error
+__ZTVSt12domain_error
+
+__ZNSt12length_errorD0Ev
+__ZNSt12length_errorD1Ev
+__ZNSt12length_errorD2Ev
+__ZTISt12length_error
+__ZTSSt12length_error
+__ZTVSt12length_error
+
+__ZNSt12out_of_rangeD0Ev
+__ZNSt12out_of_rangeD1Ev
+__ZNSt12out_of_rangeD2Ev
+__ZTISt12out_of_range
+__ZTSSt12out_of_range
+__ZTVSt12out_of_range
+
+__ZNSt14overflow_errorD0Ev
+__ZNSt14overflow_errorD1Ev
+__ZNSt14overflow_errorD2Ev
+__ZTISt14overflow_error
+__ZTSSt14overflow_error
+__ZTVSt14overflow_error
+
+__ZNSt15underflow_errorD0Ev
+__ZNSt15underflow_errorD1Ev
+__ZNSt15underflow_errorD2Ev
+__ZTISt15underflow_error
+__ZTSSt15underflow_error
+__ZTVSt15underflow_error
+
+__ZNSt16invalid_argumentD0Ev
+__ZNSt16invalid_argumentD1Ev
+__ZNSt16invalid_argumentD2Ev
+__ZTISt16invalid_argument
+__ZTSSt16invalid_argument
+__ZTVSt16invalid_argument
diff --git a/src/stdexcept.cpp b/src/stdexcept.cpp
index 2891788..b516b0c 100644
--- a/src/stdexcept.cpp
+++ b/src/stdexcept.cpp
@@ -15,6 +15,7 @@
 #include <cstdint>
 #include <cstddef>
 #include "system_error"
+#include <cxxabi.h>
 
 // Note:  optimize for size
 
@@ -113,6 +114,8 @@
     return *this;
 }
 
+#ifndef _LIBCPPABI_VERSION
+
 logic_error::~logic_error() _NOEXCEPT
 {
     __libcpp_nmstr& s = (__libcpp_nmstr&)__imp_;
@@ -126,6 +129,8 @@
     return s.c_str();
 }
 
+#endif
+
 runtime_error::runtime_error(const string& msg)
 {
     __libcpp_nmstr& s = (__libcpp_nmstr&)__imp_;
@@ -153,6 +158,8 @@
     return *this;
 }
 
+#ifndef _LIBCPPABI_VERSION
+
 runtime_error::~runtime_error() _NOEXCEPT
 {
     __libcpp_nmstr& s = (__libcpp_nmstr&)__imp_;
@@ -175,4 +182,6 @@
 overflow_error::~overflow_error() _NOEXCEPT {}
 underflow_error::~underflow_error() _NOEXCEPT {}
 
+#endif
+
 }  // std