blob: adda552b89f5009d8324e66f7dc3eb96b5d0cec8 [file] [log] [blame]
Asiri Rathnayake4174e8b2016-05-31 12:01:32 +00001//===------------------------- 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
Asiri Rathnayake4174e8b2016-05-31 12:01:32 +000016#include "cxxabi.h"
17
18#include <exception> // for std::terminate
19#include "cxa_exception.hpp"
20#include "cxa_handlers.hpp"
21
22namespace __cxxabiv1 {
23
Asiri Rathnayake4174e8b2016-05-31 12:01:32 +000024extern "C" {
25
26void
27__cxa_increment_exception_refcount(void *thrown_object) throw() {
28 if (thrown_object != nullptr)
29 std::terminate();
30}
31
32void
33__cxa_decrement_exception_refcount(void *thrown_object) throw() {
34 if (thrown_object != nullptr)
35 std::terminate();
36}
37
38
39void *__cxa_current_primary_exception() throw() { return nullptr; }
40
41void
42__cxa_rethrow_primary_exception(void* thrown_object) {
43 if (thrown_object != nullptr)
44 std::terminate();
45}
46
47bool
48__cxa_uncaught_exception() throw() { return false; }
49
50unsigned int
51__cxa_uncaught_exceptions() throw() { return 0; }
52
53} // extern "C"
54
Asiri Rathnayake4174e8b2016-05-31 12:01:32 +000055} // abi