[libcxx] r192077 - Silence the unused function warning in exception.cpp.

Peter Collingbourne peter at pcc.me.uk
Sun Oct 6 15:13:24 PDT 2013


Author: pcc
Date: Sun Oct  6 17:13:24 2013
New Revision: 192077

URL: http://llvm.org/viewvc/llvm-project?rev=192077&view=rev
Log:
Silence the unused function warning in exception.cpp.

Rather than try to protect the function behind a precise,
ever-changing #if expression, just inline it into every caller.

Modified:
    libcxx/trunk/src/exception.cpp

Modified: libcxx/trunk/src/exception.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/exception.cpp?rev=192077&r1=192076&r2=192077&view=diff
==============================================================================
--- libcxx/trunk/src/exception.cpp (original)
+++ libcxx/trunk/src/exception.cpp Sun Oct  6 17:13:24 2013
@@ -1,5 +1,3 @@
-
-
 //===------------------------ exception.cpp -------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
@@ -42,13 +40,6 @@
   static std::unexpected_handler __unexpected_handler;
 #endif // __has_include(<cxxabi.h>)
 
-_LIBCPP_NORETURN
-static void _libcpp_abort(const char* msg)
-{
-    printf("%s\n", msg);
-    abort();
-}
-
 namespace std
 {
 
@@ -99,13 +90,15 @@ terminate() _NOEXCEPT
 #endif  // _LIBCPP_NO_EXCEPTIONS
         (*get_terminate())();
         // handler should not return
-        _libcpp_abort("terminate_handler unexpectedly returned\n");
+        printf("terminate_handler unexpectedly returned\n");
+        ::abort();
 #ifndef _LIBCPP_NO_EXCEPTIONS
     }
     catch (...)
     {
         // handler should not throw exception
-        _libcpp_abort("terminate_handler unexpectedly threw an exception\n");
+        printf("terminate_handler unexpectedly threw an exception\n");
+        ::abort();
     }
 #endif  // _LIBCPP_NO_EXCEPTIONS
 }
@@ -124,7 +117,8 @@ bool uncaught_exception() _NOEXCEPT
 #   else
 #       warning uncaught_exception not yet implemented
 #   endif
-    _libcpp_abort("uncaught_exception not yet implemented\n");
+    printf("uncaught_exception not yet implemented\n");
+    ::abort();
 #endif  // __APPLE__
 }
 
@@ -196,7 +190,8 @@ exception_ptr::~exception_ptr() _NOEXCEP
 #   else
 #       warning exception_ptr not yet implemented
 #   endif
-    _libcpp_abort("exception_ptr not yet implemented\n");
+    printf("exception_ptr not yet implemented\n");
+    ::abort();
 #endif
 }
 
@@ -214,7 +209,8 @@ exception_ptr::exception_ptr(const excep
 #   else
 #       warning exception_ptr not yet implemented
 #   endif
-    _libcpp_abort("exception_ptr not yet implemented\n");
+    printf("exception_ptr not yet implemented\n");
+    ::abort();
 #endif
 }
 
@@ -238,7 +234,8 @@ exception_ptr& exception_ptr::operator=(
 #   else
 #       warning exception_ptr not yet implemented
 #   endif
-    _libcpp_abort("exception_ptr not yet implemented\n");
+    printf("exception_ptr not yet implemented\n");
+    ::abort();
 #endif
 }
 
@@ -281,7 +278,8 @@ exception_ptr current_exception() _NOEXC
 #   else
 #       warning exception_ptr not yet implemented
 #   endif
-    _libcpp_abort("exception_ptr not yet implemented\n");
+    printf("exception_ptr not yet implemented\n");
+    ::abort();
 #endif
 }
 
@@ -302,7 +300,8 @@ void rethrow_exception(exception_ptr p)
 #   else
 #       warning exception_ptr not yet implemented
 #   endif
-    _libcpp_abort("exception_ptr not yet implemented\n");
+    printf("exception_ptr not yet implemented\n");
+    ::abort();
 #endif
 }
 } // std





More information about the cfe-commits mailing list