Skip to content

Commit db43207

Browse files
Updates per PR feedback
1 parent 0499f15 commit db43207

30 files changed

+54
-73
lines changed

libcxx/include/stacktrace

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -164,29 +164,26 @@ namespace std {
164164
165165
*/
166166

167-
#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
168-
# include <__cxx03/__config>
169-
#else
170-
# include <__config>
167+
#include <__config>
171168

172-
# if _LIBCPP_STD_VER >= 23
169+
#if _LIBCPP_STD_VER >= 23
173170

174-
# include <compare> // [stacktrace.syn]
171+
# include <compare> // [stacktrace.syn]
175172

176-
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
177-
# pragma GCC system_header
178-
# endif
173+
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
174+
# pragma GCC system_header
175+
# endif
179176

180177
_LIBCPP_PUSH_MACROS
181-
# include <__undef_macros>
178+
# include <__undef_macros>
182179

183-
# include <__stacktrace/basic_stacktrace.h>
184-
# include <__stacktrace/impl.h>
185-
# include <__stacktrace/stacktrace_entry.h>
180+
# include <__stacktrace/basic_stacktrace.h>
181+
# include <__stacktrace/stacktrace_entry.h>
182+
183+
# include <__stacktrace/impl.h>
186184

187185
_LIBCPP_POP_MACROS
188186

189-
# endif // _LIBCPP_STD_VER >= 23
190-
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
187+
#endif // _LIBCPP_STD_VER >= 23
191188

192189
#endif // _LIBCPP_STACKTRACE

libcxx/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ set(LIBCXX_SOURCES
4141
ryu/d2s.cpp
4242
ryu/f2s.cpp
4343
stacktrace/linux.cpp
44-
stacktrace/osx.cpp
44+
stacktrace/macos.cpp
4545
stacktrace/stacktrace.cpp
4646
stacktrace/tools.cpp
4747
stacktrace/unwind.cpp

libcxx/src/stacktrace/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace __stacktrace {
2020
#endif
2121

2222
#if defined(__APPLE__)
23-
# define _LIBCPP_STACKTRACE_APPLE
23+
# define _LIBCPP_STACKTRACE_MACOS
2424
#endif
2525

2626
#if defined(__linux__)

libcxx/src/stacktrace/osx.cpp renamed to libcxx/src/stacktrace/macos.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,17 @@
88

99
#include "stacktrace/config.h"
1010

11-
#if defined(_LIBCPP_STACKTRACE_APPLE)
11+
#if defined(_LIBCPP_STACKTRACE_MACOS)
1212

13-
# include "stacktrace/osx.h"
13+
# include "stacktrace/context.h"
14+
# include "stacktrace/macos.h"
1415

1516
# include <algorithm>
1617
# include <array>
1718
# include <dlfcn.h>
1819
# include <mach-o/dyld.h>
1920
# include <mach-o/loader.h>
2021

21-
# include "stacktrace/config.h"
22-
# include "stacktrace/context.h"
23-
# include "stacktrace/utils.h"
2422
# include <__stacktrace/basic_stacktrace.h>
2523
# include <__stacktrace/stacktrace_entry.h>
2624

@@ -67,7 +65,7 @@ bool enum_modules(unsigned& count, auto& images) {
6765
return true;
6866
}
6967

70-
void osx::ident_modules() {
68+
void macos::ident_modules() {
7169
static unsigned imageCount;
7270
static std::array<Image, kMaxImages + 2> images;
7371
static bool atomicInitialized = enum_modules(imageCount, images);
@@ -102,7 +100,7 @@ void symbolize_entry(entry& entry) {
102100
}
103101
}
104102

105-
void osx::symbolize() {
103+
void macos::symbolize() {
106104
for (auto& entry : cx_.__entries_) {
107105
symbolize_entry(entry);
108106
}
@@ -111,4 +109,4 @@ void osx::symbolize() {
111109
} // namespace __stacktrace
112110
_LIBCPP_END_NAMESPACE_STD
113111

114-
#endif // _LIBCPP_STACKTRACE_APPLE
112+
#endif // _LIBCPP_STACKTRACE_MACOS

libcxx/src/stacktrace/osx.h renamed to libcxx/src/stacktrace/macos.h

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

9-
#ifndef _LIBCPP_STACKTRACE_OSX_H
10-
#define _LIBCPP_STACKTRACE_OSX_H
9+
#ifndef _LIBCPP_STACKTRACE_MACOS_H
10+
#define _LIBCPP_STACKTRACE_MACOS_H
1111

1212
#include <__config>
1313
#include <__config_site>
@@ -19,7 +19,7 @@ namespace __stacktrace {
1919

2020
struct context;
2121

22-
struct osx {
22+
struct macos {
2323
context& cx_;
2424
void ident_modules();
2525
void symbolize();
@@ -28,4 +28,4 @@ struct osx {
2828
} // namespace __stacktrace
2929
_LIBCPP_END_NAMESPACE_STD
3030

31-
#endif // _LIBCPP_STACKTRACE_OSX_H
31+
#endif // _LIBCPP_STACKTRACE_MACOS_H

libcxx/src/stacktrace/stacktrace.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
# include "stacktrace/linux.h"
2525
#endif
2626

27-
#if defined(_LIBCPP_STACKTRACE_APPLE)
28-
# include "stacktrace/osx.h"
27+
#if defined(_LIBCPP_STACKTRACE_MACOS)
28+
# include "stacktrace/macos.h"
2929
#endif
3030

3131
#if defined(_LIBCPP_STACKTRACE_CAN_SPAWN_TOOLS)
@@ -173,10 +173,10 @@ _LIBCPP_NO_TAIL_CALLS _LIBCPP_NOINLINE void context::do_stacktrace(size_t skip,
173173
unwind unwind{*this};
174174
auto& collector = unwind;
175175
#endif
176-
#if defined(_LIBCPP_STACKTRACE_APPLE)
177-
osx osx{*this};
178-
auto& mod_ident = osx;
179-
auto& symbolizer = osx;
176+
#if defined(_LIBCPP_STACKTRACE_MACOS)
177+
macos macos{*this};
178+
auto& mod_ident = macos;
179+
auto& symbolizer = macos;
180180
#endif
181181
#if defined(_LIBCPP_STACKTRACE_LINUX)
182182
linux linux{*this};

libcxx/src/stacktrace/unwind.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
#include <cstddef>
1515
#include <cstdlib>
1616

17-
#include "stacktrace/config.h"
1817
#include "stacktrace/context.h"
19-
#include "stacktrace/utils.h"
2018
#include <__stacktrace/basic_stacktrace.h>
2119
#include <__stacktrace/stacktrace_entry.h>
2220

libcxx/src/stacktrace/windows.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
# include "stacktrace/context.h"
1616
# include "stacktrace/utils.h"
1717
# include "stacktrace/windows.h"
18-
# include <__stacktrace/basic_stacktrace.h>
19-
# include <__stacktrace/stacktrace_entry.h>
2018

2119
_LIBCPP_BEGIN_NAMESPACE_STD
2220
namespace __stacktrace {

libcxx/src/stacktrace/windows.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#ifndef _LIBCPP_STACKTRACE_WIN_IMPL_H
1010
#define _LIBCPP_STACKTRACE_WIN_IMPL_H
1111

12+
#include "stacktrace/config.h"
13+
1214
#if defined(_LIBCPP_STACKTRACE_WINDOWS)
1315
// windows.h must be first
1416
# include <windows.h>

libcxx/test/libcxx/stacktrace/simple.o0.nodebug.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
9+
// REQUIRES: std-at-least-c++23
1010
// ADDITIONAL_COMPILE_FLAGS: -O0 -g0
1111

1212
#include <cassert>

0 commit comments

Comments
 (0)