1 //===------------------------- cxa_exception.cpp --------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 // 9 // This file implements the "Exception Handling APIs" 10 // http://mentorembedded.github.io/cxx-abi/abi-eh.html 11 // 12 //===----------------------------------------------------------------------===// 13 14 // Support functions for the no-exceptions libc++ library 15 16 #include "config.h" 17 #include "cxxabi.h" 18 19 #include <exception> // for std::terminate 20 #include "cxa_exception.hpp" 21 #include "cxa_handlers.hpp" 22 23 namespace __cxxabiv1 { 24 25 extern "C" { 26 27 void 28 __cxa_increment_exception_refcount(void *thrown_object) throw() { 29 if (thrown_object != nullptr) 30 std::terminate(); 31 } 32 33 void 34 __cxa_decrement_exception_refcount(void *thrown_object) throw() { 35 if (thrown_object != nullptr) 36 std::terminate(); 37 } 38 39 40 void *__cxa_current_primary_exception() throw() { return nullptr; } 41 42 void 43 __cxa_rethrow_primary_exception(void* thrown_object) { 44 if (thrown_object != nullptr) 45 std::terminate(); 46 } 47 48 bool 49 __cxa_uncaught_exception() throw() { return false; } 50 51 unsigned int 52 __cxa_uncaught_exceptions() throw() { return 0; } 53 54 } // extern "C" 55 56 } // abi 57