Skip to content

Commit 4668489

Browse files
Move stacktrace files out of experimental; fix feature macros
1 parent 25e2db9 commit 4668489

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+327
-332
lines changed

libcxx/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ option(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS
132132
for more details." OFF)
133133

134134
option(LIBCPP_STACKTRACE_ALLOW_TOOLS_AT_RUNTIME
135-
"For C++23 <stacktrace>: whether to allow invocation of `addr2line`, `llvm-addr2line` or `atos`
136-
at runtime (if it's available in PATH) to resolve call-chain addresses in the stacktrace
135+
"For C++23 <stacktrace>: whether to allow invocation of `addr2line`, `llvm-addr2line`, or `atos`
136+
at runtime (if one is available in PATH) to resolve call-chain addresses in the stacktrace
137137
into source locations, if other methods are not available." ON)
138138

139139
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")

libcxx/docs/FeatureTestMacroTable.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ Status
392392
---------------------------------------------------------- -----------------
393393
``__cpp_lib_spanstream`` *unimplemented*
394394
---------------------------------------------------------- -----------------
395-
``__cpp_lib_stacktrace`` *unimplemented*
395+
``__cpp_lib_stacktrace`` ``202011L``
396396
---------------------------------------------------------- -----------------
397397
``__cpp_lib_stdatomic_h`` ``202011L``
398398
---------------------------------------------------------- -----------------

libcxx/docs/VendorDocumentation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ General purpose options
189189

190190
**Default**: ``OFF``
191191

192-
For C++23 <stacktrace>: whether to allow invocation of ``addr2line`` or ``llvm-addr2line``
193-
at runtime (if it's available in PATH) to resolve call-chain addresses in the stacktrace
192+
For C++23 <stacktrace>: whether to allow invocation of ``llvm-symbolizer``, ``addr2line``, or ``atos``
193+
at runtime (if one is available in PATH) to resolve call-chain addresses in the stacktrace
194194
into source locations, if other methods are not available.
195195

196196
.. option:: LIBCXX_INSTALL_LIBRARY_DIR:PATH

libcxx/include/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,12 @@ set(files
727727
__ranges/views.h
728728
__ranges/zip_view.h
729729
__split_buffer
730+
__stacktrace/basic_stacktrace.h
731+
__stacktrace/detail/alloc.h
732+
__stacktrace/detail/context.h
733+
__stacktrace/detail/entry.h
734+
__stacktrace/detail/to_string.h
735+
__stacktrace/stacktrace_entry.h
730736
__std_mbstate_t.h
731737
__stop_token/atomic_unique_lock.h
732738
__stop_token/intrusive_list_view.h
@@ -991,17 +997,10 @@ set(files
991997
experimental/__simd/traits.h
992998
experimental/__simd/utility.h
993999
experimental/__simd/vec_ext.h
994-
experimental/__stacktrace/basic_stacktrace.h
995-
experimental/__stacktrace/detail/alloc.h
996-
experimental/__stacktrace/detail/context.h
997-
experimental/__stacktrace/detail/entry.h
998-
experimental/__stacktrace/detail/to_string.h
999-
experimental/__stacktrace/stacktrace_entry.h
10001000
experimental/iterator
10011001
experimental/memory
10021002
experimental/propagate_const
10031003
experimental/simd
1004-
experimental/stacktrace
10051004
experimental/type_traits
10061005
experimental/utility
10071006
ext/__hash
@@ -1054,6 +1053,7 @@ set(files
10541053
span
10551054
sstream
10561055
stack
1056+
stacktrace
10571057
stdatomic.h
10581058
stdbool.h
10591059
stddef.h

libcxx/include/__cxx03/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ __cpp_lib_void_t 201411L <type_traits>
495495
// # define __cpp_lib_ranges_zip 202110L
496496
// # define __cpp_lib_reference_from_temporary 202202L
497497
// # define __cpp_lib_spanstream 202106L
498-
// # define __cpp_lib_stacktrace 202011L
498+
# define __cpp_lib_stacktrace 202011L
499499
# define __cpp_lib_stdatomic_h 202011L
500500
# define __cpp_lib_string_contains 202011L
501501
# define __cpp_lib_string_resize_and_overwrite 202110L

libcxx/include/experimental/__stacktrace/basic_stacktrace.h renamed to libcxx/include/__stacktrace/basic_stacktrace.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#ifndef _LIBCPP_EXPERIMENTAL_BASIC_STACKTRACE
1111
#define _LIBCPP_EXPERIMENTAL_BASIC_STACKTRACE
1212

13-
#include <experimental/__stacktrace/detail/entry.h>
14-
#include <experimental/__stacktrace/stacktrace_entry.h>
13+
#include <__stacktrace/detail/entry.h>
14+
#include <__stacktrace/stacktrace_entry.h>
1515

1616
#include <__config>
1717
#include <__format/formatter.h>
@@ -37,9 +37,9 @@
3737
#include <memory>
3838
#include <string>
3939

40-
#include <experimental/__stacktrace/detail/alloc.h>
41-
#include <experimental/__stacktrace/detail/context.h>
42-
#include <experimental/__stacktrace/detail/to_string.h>
40+
#include <__stacktrace/detail/alloc.h>
41+
#include <__stacktrace/detail/context.h>
42+
#include <__stacktrace/detail/to_string.h>
4343

4444
_LIBCPP_BEGIN_NAMESPACE_STD
4545

libcxx/include/experimental/__stacktrace/detail/alloc.h renamed to libcxx/include/__stacktrace/detail/alloc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
//
88
//===----------------------------------------------------------------------===//
99

10-
#ifndef _LIBCPP_EXPERIMENTAL_STACKTRACE_ALLOC
11-
#define _LIBCPP_EXPERIMENTAL_STACKTRACE_ALLOC
10+
#ifndef _LIBCPP_STACKTRACE_ALLOC
11+
#define _LIBCPP_STACKTRACE_ALLOC
1212

1313
#include <__config>
1414
#include <__functional/function.h>
@@ -100,4 +100,4 @@ struct alloc final : std::pmr::memory_resource {
100100
} // namespace __stacktrace
101101
_LIBCPP_END_NAMESPACE_STD
102102

103-
#endif // _LIBCPP_EXPERIMENTAL_STACKTRACE_ALLOC
103+
#endif // _LIBCPP_STACKTRACE_ALLOC

libcxx/include/experimental/__stacktrace/detail/context.h renamed to libcxx/include/__stacktrace/detail/context.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
//
88
//===----------------------------------------------------------------------===//
99

10-
#ifndef _LIBCPP_EXPERIMENTAL_STACKTRACE_CONTEXT
11-
#define _LIBCPP_EXPERIMENTAL_STACKTRACE_CONTEXT
10+
#ifndef _LIBCPP_STACKTRACE_CONTEXT
11+
#define _LIBCPP_STACKTRACE_CONTEXT
1212

1313
#include <__config>
1414
#include <__memory_resource/memory_resource.h>
@@ -18,8 +18,8 @@
1818
#include <cstddef>
1919
#include <string>
2020

21-
#include <experimental/__stacktrace/detail/alloc.h>
22-
#include <experimental/__stacktrace/detail/entry.h>
21+
#include <__stacktrace/detail/alloc.h>
22+
#include <__stacktrace/detail/entry.h>
2323

2424
_LIBCPP_BEGIN_NAMESPACE_STD
2525

@@ -50,4 +50,4 @@ struct _LIBCPP_HIDE_FROM_ABI context {
5050
} // namespace __stacktrace
5151
_LIBCPP_END_NAMESPACE_STD
5252

53-
#endif // _LIBCPP_EXPERIMENTAL_STACKTRACE_CONTEXT
53+
#endif // _LIBCPP_STACKTRACE_CONTEXT

libcxx/include/experimental/__stacktrace/detail/entry.h renamed to libcxx/include/__stacktrace/detail/entry.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
//
88
//===----------------------------------------------------------------------===//
99

10-
#ifndef _LIBCPP_EXPERIMENTAL_STACKTRACE_DETAIL_ENTRY
11-
#define _LIBCPP_EXPERIMENTAL_STACKTRACE_DETAIL_ENTRY
10+
#ifndef _LIBCPP_STACKTRACE_DETAIL_ENTRY
11+
#define _LIBCPP_STACKTRACE_DETAIL_ENTRY
1212

1313
#include <__config>
1414
#include <cstdint>
@@ -41,4 +41,4 @@ struct _LIBCPP_HIDE_FROM_ABI entry {
4141
} // namespace __stacktrace
4242
_LIBCPP_END_NAMESPACE_STD
4343

44-
#endif // _LIBCPP_EXPERIMENTAL_STACKTRACE_DETAIL_ENTRY
44+
#endif // _LIBCPP_STACKTRACE_DETAIL_ENTRY

libcxx/include/experimental/__stacktrace/detail/to_string.h renamed to libcxx/include/__stacktrace/detail/to_string.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
//
88
//===----------------------------------------------------------------------===//
99

10-
#ifndef _LIBCPP_EXPERIMENTAL_STACKTRACE_TO_STRING
11-
#define _LIBCPP_EXPERIMENTAL_STACKTRACE_TO_STRING
10+
#ifndef _LIBCPP_STACKTRACE_TO_STRING
11+
#define _LIBCPP_STACKTRACE_TO_STRING
1212

1313
#include <__config>
1414
#include <__fwd/sstream.h>
@@ -43,4 +43,4 @@ struct _LIBCPP_HIDE_FROM_ABI __to_string {
4343

4444
_LIBCPP_END_NAMESPACE_STD
4545

46-
#endif // _LIBCPP_EXPERIMENTAL_STACKTRACE_TO_STRING
46+
#endif // _LIBCPP_STACKTRACE_TO_STRING

libcxx/include/experimental/__stacktrace/stacktrace_entry.h renamed to libcxx/include/__stacktrace/stacktrace_entry.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
//
88
//===----------------------------------------------------------------------===//
99

10-
#ifndef _LIBCPP_EXPERIMENTAL_STACKTRACE_ENTRY
11-
#define _LIBCPP_EXPERIMENTAL_STACKTRACE_ENTRY
10+
#ifndef _LIBCPP_STACKTRACE_ENTRY
11+
#define _LIBCPP_STACKTRACE_ENTRY
1212

1313
#include <__cstddef/byte.h>
1414
#include <__cstddef/ptrdiff_t.h>
@@ -33,7 +33,7 @@
3333
#include <cstdint>
3434
#include <string>
3535

36-
#include "experimental/__stacktrace/detail/entry.h"
36+
#include "__stacktrace/detail/entry.h"
3737

3838
_LIBCPP_BEGIN_NAMESPACE_STD
3939

@@ -108,4 +108,4 @@ struct _LIBCPP_EXPORTED_FROM_ABI hash<stacktrace_entry> {
108108

109109
_LIBCPP_END_NAMESPACE_STD
110110

111-
#endif // _LIBCPP_EXPERIMENTAL_STACKTRACE_ENTRY
111+
#endif // _LIBCPP_STACKTRACE_ENTRY

libcxx/include/module.modulemap.in

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,6 +1985,17 @@ module std [system] {
19851985
export *
19861986
}
19871987

1988+
module stacktrace {
1989+
private header "__stacktrace/basic_stacktrace.h"
1990+
private header "__stacktrace/detail/alloc.h"
1991+
private header "__stacktrace/detail/context.h"
1992+
private header "__stacktrace/detail/entry.h"
1993+
private header "__stacktrace/detail/to_string.h"
1994+
private header "__stacktrace/stacktrace_entry.h"
1995+
header "stacktrace"
1996+
export *
1997+
}
1998+
19881999
module stdexcept {
19892000
header "stdexcept"
19902001
export *
@@ -2225,16 +2236,6 @@ module std [system] {
22252236
header "experimental/simd"
22262237
export *
22272238
}
2228-
module stacktrace {
2229-
private header "experimental/__stacktrace/basic_stacktrace.h"
2230-
private header "experimental/__stacktrace/detail/alloc.h"
2231-
private header "experimental/__stacktrace/detail/context.h"
2232-
private header "experimental/__stacktrace/detail/entry.h"
2233-
private header "experimental/__stacktrace/detail/to_string.h"
2234-
private header "experimental/__stacktrace/stacktrace_entry.h"
2235-
header "experimental/stacktrace"
2236-
export *
2237-
}
22382239
}
22392240

22402241
// Implementation detail headers that are private to libc++. These modules

libcxx/include/experimental/stacktrace renamed to libcxx/include/stacktrace

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ namespace std {
180180
_LIBCPP_PUSH_MACROS
181181
# include <__undef_macros>
182182

183-
# include "experimental/__stacktrace/basic_stacktrace.h"
184-
# include "experimental/__stacktrace/stacktrace_entry.h"
183+
# include "__stacktrace/basic_stacktrace.h"
184+
# include "__stacktrace/stacktrace_entry.h"
185185

186186
_LIBCPP_POP_MACROS
187187

libcxx/include/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ __cpp_lib_void_t 201411L <type_traits>
524524
// # define __cpp_lib_ranges_zip 202110L
525525
// # define __cpp_lib_reference_from_temporary 202202L
526526
// # define __cpp_lib_spanstream 202106L
527-
// # define __cpp_lib_stacktrace 202011L
527+
# define __cpp_lib_stacktrace 202011L
528528
# define __cpp_lib_stdatomic_h 202011L
529529
# define __cpp_lib_string_contains 202011L
530530
# define __cpp_lib_string_resize_and_overwrite 202110L

libcxx/modules/std.compat.cppm.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ module;
7171
# if __has_include(<spanstream>)
7272
# error "please update the header information for <spanstream> in headers_not_available in utils/libcxx/header_information.py"
7373
# endif // __has_include(<spanstream>)
74-
# if __has_include(<stacktrace>)
75-
# error "please update the header information for <stacktrace> in headers_not_available in utils/libcxx/header_information.py"
76-
# endif // __has_include(<stacktrace>)
7774
# if __has_include(<stdfloat>)
7875
# error "please update the header information for <stdfloat> in headers_not_available in utils/libcxx/header_information.py"
7976
# endif // __has_include(<stdfloat>)

libcxx/modules/std.cppm.in

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ module;
124124
# include <sstream>
125125
#endif
126126
#include <stack>
127+
#include <stacktrace>
127128
#include <stdexcept>
128129
#include <stop_token>
129130
#if _LIBCPP_HAS_LOCALIZATION
@@ -181,9 +182,6 @@ module;
181182
# if __has_include(<spanstream>)
182183
# error "please update the header information for <spanstream> in headers_not_available in utils/libcxx/header_information.py"
183184
# endif // __has_include(<spanstream>)
184-
# if __has_include(<stacktrace>)
185-
# error "please update the header information for <stacktrace> in headers_not_available in utils/libcxx/header_information.py"
186-
# endif // __has_include(<stacktrace>)
187185
# if __has_include(<stdfloat>)
188186
# error "please update the header information for <stdfloat> in headers_not_available in utils/libcxx/header_information.py"
189187
# endif // __has_include(<stdfloat>)

libcxx/modules/std/stacktrace.inc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
//===----------------------------------------------------------------------===//
99

1010
export namespace std {
11-
// TODO(stacktrace23): update this when stacktrace is taken out of experimental
12-
#if 0 //_LIBCPP_STD_VER >= 23
11+
#if _LIBCPP_STD_VER >= 23
1312

1413
// [stacktrace.entry], class stacktrace_­entry
1514
using std::stacktrace_entry;

libcxx/src/CMakeLists.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,24 @@ set(LIBCXX_SOURCES
4040
ryu/d2fixed.cpp
4141
ryu/d2s.cpp
4242
ryu/f2s.cpp
43+
stacktrace/alloc.cpp
44+
stacktrace/common/debug.cpp
45+
stacktrace/common/fd.cpp
46+
stacktrace/context.cpp
47+
stacktrace/linux/linux-dl.cpp
48+
stacktrace/linux/linux-elf.cpp
49+
stacktrace/linux/linux-sym.cpp
50+
stacktrace/osx/osx.cpp
51+
stacktrace/stacktrace.cpp
52+
stacktrace/tools/addr2line.cpp
53+
stacktrace/tools/atos.cpp
54+
stacktrace/tools/llvm_symbolizer.cpp
55+
stacktrace/tools/toolspawner.cpp
56+
stacktrace/unwind/unwind.cpp
57+
stacktrace/windows/dbghelp_dll.cpp
58+
stacktrace/windows/dll.cpp
59+
stacktrace/windows/psapi_dll.cpp
60+
stacktrace/windows/win_impl.cpp
4361
stdexcept.cpp
4462
string.cpp
4563
support/runtime/exception_fallback.ipp
@@ -309,24 +327,6 @@ add_custom_target(cxx DEPENDS ${LIBCXX_BUILD_TARGETS})
309327
# Build the experimental static library
310328
set(LIBCXX_EXPERIMENTAL_SOURCES
311329
experimental/keep.cpp
312-
experimental/stacktrace/alloc.cpp
313-
experimental/stacktrace/common/debug.cpp
314-
experimental/stacktrace/common/fd.cpp
315-
experimental/stacktrace/context.cpp
316-
experimental/stacktrace/linux/linux-dl.cpp
317-
experimental/stacktrace/linux/linux-elf.cpp
318-
experimental/stacktrace/linux/linux-sym.cpp
319-
experimental/stacktrace/osx/osx.cpp
320-
experimental/stacktrace/stacktrace.cpp
321-
experimental/stacktrace/tools/addr2line.cpp
322-
experimental/stacktrace/tools/atos.cpp
323-
experimental/stacktrace/tools/llvm_symbolizer.cpp
324-
experimental/stacktrace/tools/toolspawner.cpp
325-
experimental/stacktrace/unwind/unwind.cpp
326-
experimental/stacktrace/windows/dbghelp_dll.cpp
327-
experimental/stacktrace/windows/dll.cpp
328-
experimental/stacktrace/windows/psapi_dll.cpp
329-
experimental/stacktrace/windows/win_impl.cpp
330330
)
331331

332332
if (LIBCXX_PSTL_BACKEND STREQUAL "libdispatch")

0 commit comments

Comments
 (0)