[cfe-commits] [libcxxabi] r148866 - in /libcxxabi/trunk/src: cxa_vector.cpp exception.cpp

Howard Hinnant hhinnant at apple.com
Tue Jan 24 13:48:11 PST 2012


Author: hhinnant
Date: Tue Jan 24 15:48:10 2012
New Revision: 148866

URL: http://llvm.org/viewvc/llvm-project?rev=148866&view=rev
Log:
Add some needed symbols in exception.cpp and eliminate dependence upon uncaught_exception() from cxa_vector.cpp.  libc++abi is very nearly a self-contained (though not complete) library now.

Added:
    libcxxabi/trunk/src/exception.cpp
Modified:
    libcxxabi/trunk/src/cxa_vector.cpp

Modified: libcxxabi/trunk/src/cxa_vector.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_vector.cpp?rev=148866&r1=148865&r2=148866&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_vector.cpp (original)
+++ libcxxabi/trunk/src/cxa_vector.cpp Tue Jan 24 15:48:10 2012
@@ -258,7 +258,7 @@
         size_t idx = element_count;
         st_cxa_cleanup cleanup ( array_address, idx, element_size, destructor );        
         {
-            st_terminate exception_guard (std::uncaught_exception ());
+            st_terminate exception_guard (__cxa_uncaught_exception ());
             ptr +=  element_count * element_size;   // one past the last element
 
             while ( idx-- > 0 ) {

Added: libcxxabi/trunk/src/exception.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/exception.cpp?rev=148866&view=auto
==============================================================================
--- libcxxabi/trunk/src/exception.cpp (added)
+++ libcxxabi/trunk/src/exception.cpp Tue Jan 24 15:48:10 2012
@@ -0,0 +1,41 @@
+//===---------------------------- exception.cpp ---------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <exception>
+
+#pragma GCC visibility push(default)
+
+namespace std
+{
+
+// exception
+
+exception::~exception() _NOEXCEPT
+{
+}
+
+const char* exception::what() const _NOEXCEPT
+{
+  return "std::exception";
+}
+
+// bad_exception
+
+bad_exception::~bad_exception() _NOEXCEPT
+{
+}
+
+const char* bad_exception::what() const _NOEXCEPT
+{
+  return "std::bad_exception";
+}
+
+}  // std
+
+#pragma GCC visibility pop





More information about the cfe-commits mailing list