1 //===------------------------ cxa_aux_runtime.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 "Auxiliary Runtime APIs"
10 // http://mentorembedded.github.io/cxx-abi/abi-eh.html#cxx-aux
11 //===----------------------------------------------------------------------===//
12 
13 #include "cxxabi.h"
14 #include <new>
15 #include <typeinfo>
16 
17 namespace __cxxabiv1
18 {
19 
20 extern "C"
21 {
22 
23 LIBCXXABI_NORETURN
__cxa_bad_cast(void)24 void __cxa_bad_cast (void) {
25     throw std::bad_cast();
26 }
27 
28 LIBCXXABI_NORETURN
__cxa_bad_typeid(void)29 void __cxa_bad_typeid(void) {
30     throw std::bad_typeid();
31 }
32 
33 LIBCXXABI_NORETURN
__cxa_throw_bad_array_new_length(void)34 void __cxa_throw_bad_array_new_length(void) {
35     throw std::bad_array_new_length();
36 }
37 }  // extern "C"
38 
39 }  // abi
40