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