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 #pragma GCC visibility push(default) 26 27 extern "C" { 28 29 void __cxa_increment_exception_refcount(void * thrown_object)30__cxa_increment_exception_refcount(void *thrown_object) throw() { 31 if (thrown_object != nullptr) 32 std::terminate(); 33 } 34 35 void __cxa_decrement_exception_refcount(void * thrown_object)36__cxa_decrement_exception_refcount(void *thrown_object) throw() { 37 if (thrown_object != nullptr) 38 std::terminate(); 39 } 40 41 __cxa_current_primary_exception()42void *__cxa_current_primary_exception() throw() { return nullptr; } 43 44 void __cxa_rethrow_primary_exception(void * thrown_object)45__cxa_rethrow_primary_exception(void* thrown_object) { 46 if (thrown_object != nullptr) 47 std::terminate(); 48 } 49 50 bool __cxa_uncaught_exception()51__cxa_uncaught_exception() throw() { return false; } 52 53 unsigned int __cxa_uncaught_exceptions()54__cxa_uncaught_exceptions() throw() { return 0; } 55 56 } // extern "C" 57 58 #pragma GCC visibility pop 59 60 } // abi 61