Skip to content

Commit e025714

Browse files
committed
Update libc++ generated files, and add __assertion_handler.
1 parent e7cb0e2 commit e025714

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

lib/libc++/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@ STD_HEADERS+= wctype.h
248248
STD+= ${HDRDIR}/${hdr}
249249
.endfor
250250

251+
# Special case for __assertion_handler, which as of libc++ 18.0.0 is generated
252+
# by CMake.
253+
STD+= ${.CURDIR}/__assertion_handler
254+
251255
# Special case for __config_site, which as of libc++ 12.0.0 is generated by
252256
# CMake, and as of 13.0.0 installed side-by-side with__config.
253257
STD+= ${.CURDIR}/__config_site

lib/libc++/__assertion_handler

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// -*- C++ -*-
2+
//===----------------------------------------------------------------------===//
3+
//
4+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5+
// See https://llvm.org/LICENSE.txt for license information.
6+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+
//
8+
//===----------------------------------------------------------------------===//
9+
10+
#ifndef _LIBCPP___ASSERTION_HANDLER
11+
#define _LIBCPP___ASSERTION_HANDLER
12+
13+
#include <__config>
14+
#include <__verbose_abort>
15+
16+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17+
# pragma GCC system_header
18+
#endif
19+
20+
#if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
21+
22+
# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_ABORT("%s", message)
23+
24+
#else
25+
26+
// TODO(hardening): use `__builtin_verbose_trap(message)` once that becomes available.
27+
# define _LIBCPP_ASSERTION_HANDLER(message) ((void)message, __builtin_trap())
28+
29+
#endif // _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
30+
31+
#endif // _LIBCPP___ASSERTION_HANDLER

lib/libc++/__config_site

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
/* #undef _LIBCPP_HAS_NO_RANDOM_DEVICE */
2828
/* #undef _LIBCPP_HAS_NO_LOCALIZATION */
2929
/* #undef _LIBCPP_HAS_NO_WIDE_CHARACTERS */
30-
#define _LIBCPP_HAS_NO_STD_MODULES
30+
/* #undef _LIBCPP_HAS_NO_STD_MODULES */
3131
#define _LIBCPP_HAS_NO_TIME_ZONE_DATABASE
3232
/* #undef _LIBCPP_INSTRUMENTED_WITH_ASAN */
3333

lib/libc++/module.modulemap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,6 +1580,7 @@ module std_private_numeric_pstl_transform_reduce [system] {
15801580
export *
15811581
}
15821582
module std_private_numeric_reduce [system] { header "__numeric/reduce.h" }
1583+
module std_private_numeric_saturation_arithmetic [system] { header "__numeric/saturation_arithmetic.h" }
15831584
module std_private_numeric_transform_exclusive_scan [system] { header "__numeric/transform_exclusive_scan.h" }
15841585
module std_private_numeric_transform_inclusive_scan [system] { header "__numeric/transform_inclusive_scan.h" }
15851586
module std_private_numeric_transform_reduce [system] { header "__numeric/transform_reduce.h" }

0 commit comments

Comments
 (0)