annotate libcxxabi/src/cxa_noexception.cpp @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 //===------------------------- cxa_exception.cpp --------------------------===//
anatofuz
parents:
diff changeset
2 //
anatofuz
parents:
diff changeset
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
anatofuz
parents:
diff changeset
4 // See https://llvm.org/LICENSE.txt for license information.
anatofuz
parents:
diff changeset
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
anatofuz
parents:
diff changeset
6 //
anatofuz
parents:
diff changeset
7 //
anatofuz
parents:
diff changeset
8 // This file implements the "Exception Handling APIs"
anatofuz
parents:
diff changeset
9 // https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html
anatofuz
parents:
diff changeset
10 //
anatofuz
parents:
diff changeset
11 //===----------------------------------------------------------------------===//
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 // Support functions for the no-exceptions libc++ library
anatofuz
parents:
diff changeset
14
anatofuz
parents:
diff changeset
15 #include "cxxabi.h"
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 #include <exception> // for std::terminate
anatofuz
parents:
diff changeset
18 #include "cxa_exception.h"
anatofuz
parents:
diff changeset
19 #include "cxa_handlers.h"
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 namespace __cxxabiv1 {
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 extern "C" {
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 void
anatofuz
parents:
diff changeset
26 __cxa_increment_exception_refcount(void *thrown_object) throw() {
anatofuz
parents:
diff changeset
27 if (thrown_object != nullptr)
anatofuz
parents:
diff changeset
28 std::terminate();
anatofuz
parents:
diff changeset
29 }
anatofuz
parents:
diff changeset
30
anatofuz
parents:
diff changeset
31 void
anatofuz
parents:
diff changeset
32 __cxa_decrement_exception_refcount(void *thrown_object) throw() {
anatofuz
parents:
diff changeset
33 if (thrown_object != nullptr)
anatofuz
parents:
diff changeset
34 std::terminate();
anatofuz
parents:
diff changeset
35 }
anatofuz
parents:
diff changeset
36
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 void *__cxa_current_primary_exception() throw() { return nullptr; }
anatofuz
parents:
diff changeset
39
anatofuz
parents:
diff changeset
40 void
anatofuz
parents:
diff changeset
41 __cxa_rethrow_primary_exception(void* thrown_object) {
anatofuz
parents:
diff changeset
42 if (thrown_object != nullptr)
anatofuz
parents:
diff changeset
43 std::terminate();
anatofuz
parents:
diff changeset
44 }
anatofuz
parents:
diff changeset
45
anatofuz
parents:
diff changeset
46 bool
anatofuz
parents:
diff changeset
47 __cxa_uncaught_exception() throw() { return false; }
anatofuz
parents:
diff changeset
48
anatofuz
parents:
diff changeset
49 unsigned int
anatofuz
parents:
diff changeset
50 __cxa_uncaught_exceptions() throw() { return 0; }
anatofuz
parents:
diff changeset
51
anatofuz
parents:
diff changeset
52 } // extern "C"
anatofuz
parents:
diff changeset
53
anatofuz
parents:
diff changeset
54 // provide dummy implementations for the 'no exceptions' case.
anatofuz
parents:
diff changeset
55 uint64_t __getExceptionClass (const _Unwind_Exception*) { return 0; }
anatofuz
parents:
diff changeset
56 void __setExceptionClass ( _Unwind_Exception*, uint64_t) {}
anatofuz
parents:
diff changeset
57 bool __isOurExceptionClass(const _Unwind_Exception*) { return false; }
anatofuz
parents:
diff changeset
58
anatofuz
parents:
diff changeset
59 } // abi