Louis Dionne | eb8650a | 2021-11-17 21:25:01 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 2 | // |
Chandler Carruth | 57b08b0 | 2019-01-19 10:56:40 | [diff] [blame] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
Louis Dionne | 280d68e | 2023-07-11 18:55:26 | [diff] [blame] | 9 | #include <__verbose_abort> |
Arthur O'Dwyer | bbb0f2c | 2022-02-11 18:00:39 | [diff] [blame] | 10 | #include <new> |
| 11 | #include <stdexcept> |
| 12 | #include <string> |
Eric Fiselier | 2710d8e | 2019-03-06 20:31:57 | [diff] [blame] | 13 | |
| 14 | #ifdef _LIBCPP_ABI_VCRUNTIME |
Louis Dionne | 280d68e | 2023-07-11 18:55:26 | [diff] [blame] | 15 | # include "support/runtime/stdexcept_vcruntime.ipp" |
Eric Fiselier | 2710d8e | 2019-03-06 20:31:57 | [diff] [blame] | 16 | #else |
Louis Dionne | 280d68e | 2023-07-11 18:55:26 | [diff] [blame] | 17 | # include "support/runtime/stdexcept_default.ipp" |
Richard Smith | 11ffde3 | 2012-04-19 01:36:12 | [diff] [blame] | 18 | #endif |
Louis Dionne | 280d68e | 2023-07-11 18:55:26 | [diff] [blame] | 19 | |
| 20 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 21 | |
Nikolas Klauser | 748023dc | 2024-09-11 06:59:46 | [diff] [blame] | 22 | void __throw_runtime_error(const char* msg) { |
Nikolas Klauser | ba87515 | 2024-10-12 07:49:52 | [diff] [blame] | 23 | #if _LIBCPP_HAS_EXCEPTIONS |
Louis Dionne | 280d68e | 2023-07-11 18:55:26 | [diff] [blame] | 24 | throw runtime_error(msg); |
| 25 | #else |
| 26 | _LIBCPP_VERBOSE_ABORT("runtime_error was thrown in -fno-exceptions mode with message \"%s\"", msg); |
| 27 | #endif |
| 28 | } |
| 29 | |
| 30 | _LIBCPP_END_NAMESPACE_STD |