Skip to content

Commit 51c3fb5

Browse files
foo
1 parent f36bc5e commit 51c3fb5

33 files changed

+72
-78
lines changed

libcxx/include/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -728,10 +728,10 @@ set(files
728728
__ranges/zip_view.h
729729
__split_buffer
730730
__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
731+
__stacktrace/alloc.h
732+
__stacktrace/context.h
733+
__stacktrace/entry.h
734+
__stacktrace/to_string.h
735735
__stacktrace/stacktrace_entry.h
736736
__std_mbstate_t.h
737737
__stop_token/atomic_unique_lock.h

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

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace __stacktrace {
2929
/** Per-stacktrace-invocation allocator which wraps a caller-provided allocator of any type.
3030
This is intended to be used with `std::pmr::` containers and strings throughout the stacktrace
3131
creation process. */
32-
struct alloc final : std::pmr::memory_resource {
32+
struct _LIBCPP_HIDDEN alloc final : std::pmr::memory_resource {
3333
template <class _Allocator>
3434
_LIBCPP_HIDE_FROM_ABI explicit alloc(_Allocator const& __a) {
3535
// Take the given allocator type, and rebind with a new type having <byte> as the template arg
@@ -38,28 +38,22 @@ struct alloc final : std::pmr::memory_resource {
3838
auto __ba = _BA(__a);
3939
__alloc_func_ = [__ba](size_t __sz) mutable { return __ba.allocate(__sz); };
4040
__dealloc_func_ = [__ba](void* __ptr, size_t __sz) mutable { return __ba.deallocate((std::byte*)__ptr, __sz); };
41-
__alloc_opaque_ = std::addressof(__a);
41+
__alloc_ptr = std::addressof(__a);
4242
}
4343

44-
_LIBCPP_HIDE_FROM_ABI_VIRTUAL ~alloc() override = default;
44+
_LIBCPP_HIDE_FROM_ABI ~alloc() override;
4545

46-
_LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void _anchor_vfunc();
47-
48-
_LIBCPP_HIDE_FROM_ABI_VIRTUAL void* do_allocate(size_t __size, size_t __align) override {
49-
// Avoiding "assert" in a system header, but we expect this to hold:
50-
// assert(__align <= alignof(std::max_align_t));
51-
(void)__align;
46+
_LIBCPP_HIDE_FROM_ABI_VIRTUAL void* do_allocate(size_t __size, size_t /*__align*/) override {
5247
return __alloc_func_(__size);
5348
}
5449

55-
_LIBCPP_HIDE_FROM_ABI_VIRTUAL void do_deallocate(void* __ptr, size_t __size, size_t __align) override {
56-
(void)__align;
50+
_LIBCPP_HIDE_FROM_ABI_VIRTUAL void do_deallocate(void* __ptr, size_t __size, size_t /*__align*/) override {
5751
__dealloc_func_((std::byte*)__ptr, __size);
5852
}
5953

6054
_LIBCPP_HIDE_FROM_ABI_VIRTUAL bool do_is_equal(std::pmr::memory_resource const& __rhs) const noexcept override {
6155
auto* __rhs_ba = dynamic_cast<alloc const*>(&__rhs);
62-
return __rhs_ba && (__rhs_ba->__alloc_opaque_ == __alloc_opaque_);
56+
return __rhs_ba && (__rhs_ba->__alloc_ptr == __alloc_ptr);
6357
}
6458

6559
_LIBCPP_HIDE_FROM_ABI std::pmr::string new_string(size_t __size = 0) {
@@ -93,8 +87,8 @@ struct alloc final : std::pmr::memory_resource {
9387
private:
9488
std::function<std::byte*(size_t)> __alloc_func_;
9589
std::function<void(std::byte*, size_t)> __dealloc_func_;
96-
/** Only used for equality */
97-
void const* __alloc_opaque_;
90+
/** Only used for checking equality */
91+
void const* __alloc_ptr;
9892
};
9993

10094
} // namespace __stacktrace

libcxx/include/__stacktrace/basic_stacktrace.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#ifndef _LIBCPP_BASIC_STACKTRACE
1111
#define _LIBCPP_BASIC_STACKTRACE
1212

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

1616
#include <__config>
@@ -37,9 +37,9 @@
3737
#include <memory>
3838
#include <string>
3939

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

4444
_LIBCPP_BEGIN_NAMESPACE_STD
4545

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@
1818
#include <cstddef>
1919
#include <string>
2020

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

2424
_LIBCPP_BEGIN_NAMESPACE_STD
2525

26-
struct _LIBCPP_HIDE_FROM_ABI alloc;
27-
struct _LIBCPP_HIDE_FROM_ABI entry;
26+
struct _LIBCPP_HIDDEN alloc;
27+
struct _LIBCPP_HIDDEN entry;
2828

2929
namespace __stacktrace {
3030

3131
/** Represents the state of the current in-progress stacktrace operation. This includes
3232
the working list of `entry` objects, as well as the caller-provided allocator (wrapped
3333
in `polymorphic_allocator`) and a handful of utility functions involving that allocator. */
34-
struct _LIBCPP_HIDE_FROM_ABI context {
34+
struct _LIBCPP_HIDDEN context {
3535
/** Encapsulates and type-removes the caller's allocator. */
3636
alloc& __alloc_;
3737

@@ -41,10 +41,10 @@ struct _LIBCPP_HIDE_FROM_ABI context {
4141
/** Path to this process's main executable. */
4242
std::pmr::string __main_prog_path_;
4343

44-
_LIBCPP_HIDE_FROM_ABI explicit context(alloc& __byte_alloc)
44+
_LIBCPP_HIDDEN explicit context(alloc& __byte_alloc)
4545
: __alloc_(__byte_alloc), __entries_(&__alloc_), __main_prog_path_(__alloc_.new_string()) {}
4646

47-
_LIBCPP_NO_TAIL_CALLS _LIBCPP_NOINLINE void do_stacktrace(size_t __skip, size_t __max_depth);
47+
_LIBCPP_NO_TAIL_CALLS _LIBCPP_NOINLINE _LIBCPP_HIDDEN void do_stacktrace(size_t __skip, size_t __max_depth);
4848
};
4949

5050
} // namespace __stacktrace

libcxx/include/__stacktrace/stacktrace_entry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include <cstdint>
3434
#include <string>
3535

36-
#include <__stacktrace/detail/entry.h>
36+
#include <__stacktrace/entry.h>
3737

3838
_LIBCPP_BEGIN_NAMESPACE_STD
3939

libcxx/include/module.modulemap.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,10 +1987,10 @@ module std [system] {
19871987

19881988
module stacktrace {
19891989
module basic_stacktrace { header "__stacktrace/basic_stacktrace.h" }
1990-
module alloc { header "__stacktrace/detail/alloc.h" }
1991-
module context { header "__stacktrace/detail/context.h" }
1992-
module entry { header "__stacktrace/detail/entry.h" }
1993-
module to_string { header "__stacktrace/detail/to_string.h" }
1990+
module alloc { header "__stacktrace/alloc.h" }
1991+
module context { header "__stacktrace/context.h" }
1992+
module entry { header "__stacktrace/entry.h" }
1993+
module to_string { header "__stacktrace/to_string.h" }
19941994
module stacktrace_entry { header "__stacktrace/stacktrace_entry.h" }
19951995
header "stacktrace"
19961996
export *

libcxx/src/stacktrace/alloc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
#include <__config>
1010
#include <__config_site>
1111

12-
#include <__stacktrace/detail/alloc.h>
12+
#include <__stacktrace/alloc.h>
1313

1414
_LIBCPP_BEGIN_NAMESPACE_STD
1515
namespace __stacktrace {
1616

17-
void alloc::~alloc() {}
17+
alloc::~alloc() {}
1818

1919
} // namespace __stacktrace
2020
_LIBCPP_END_NAMESPACE_STD

libcxx/src/stacktrace/context.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
#include <__stacktrace/basic_stacktrace.h>
1515
#include <__stacktrace/stacktrace_entry.h>
1616

17-
#include <__stacktrace/detail/alloc.h>
18-
#include <__stacktrace/detail/context.h>
19-
#include <__stacktrace/detail/entry.h>
20-
#include <__stacktrace/detail/to_string.h>
17+
#include <__stacktrace/alloc.h>
18+
#include <__stacktrace/context.h>
19+
#include <__stacktrace/entry.h>
20+
#include <__stacktrace/to_string.h>
2121

2222
#include "common/config.h"
2323

@@ -44,7 +44,7 @@
4444
_LIBCPP_BEGIN_NAMESPACE_STD
4545
namespace __stacktrace {
4646

47-
_LIBCPP_NO_TAIL_CALLS _LIBCPP_NOINLINE void context::do_stacktrace(size_t skip, size_t max_depth) {
47+
_LIBCPP_NO_TAIL_CALLS _LIBCPP_NOINLINE _LIBCPP_HIDDEN void context::do_stacktrace(size_t skip, size_t max_depth) {
4848
/*
4949
Here we declare stacktrace components or "backends" which will handle the different tasks:
5050

libcxx/src/stacktrace/linux/linux-dl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
# include "../common/images.h"
2121

22-
# include <__stacktrace/detail/context.h>
23-
# include <__stacktrace/detail/entry.h>
22+
# include <__stacktrace/context.h>
23+
# include <__stacktrace/entry.h>
2424

2525
_LIBCPP_BEGIN_NAMESPACE_STD
2626
namespace __stacktrace {

libcxx/src/stacktrace/linux/linux-elf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
# include <cassert>
1616
# include <unistd.h>
1717

18-
# include <__stacktrace/detail/context.h>
19-
# include <__stacktrace/detail/entry.h>
18+
# include <__stacktrace/context.h>
19+
# include <__stacktrace/entry.h>
2020

2121
# include "../common/fd.h"
2222
# include "elf.h"

libcxx/src/stacktrace/linux/linux-sym.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
# include <dlfcn.h>
1717
# include <unistd.h>
1818

19-
# include <__stacktrace/detail/context.h>
20-
# include <__stacktrace/detail/entry.h>
19+
# include <__stacktrace/context.h>
20+
# include <__stacktrace/entry.h>
2121

2222
_LIBCPP_BEGIN_NAMESPACE_STD
2323
namespace __stacktrace {

libcxx/src/stacktrace/linux/linux.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
_LIBCPP_BEGIN_NAMESPACE_STD
2828
namespace __stacktrace {
2929

30-
struct _LIBCPP_HIDE_FROM_ABI context;
30+
struct context;
3131

3232
struct linux {
3333
context& cx_;

libcxx/src/stacktrace/osx/osx.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
# include <mach-o/dyld.h>
1717
# include <mach-o/loader.h>
1818

19-
# include <__stacktrace/detail/context.h>
20-
# include <__stacktrace/detail/entry.h>
19+
# include <__stacktrace/context.h>
20+
# include <__stacktrace/entry.h>
2121

2222
# include "osx.h"
2323

libcxx/src/stacktrace/osx/osx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
_LIBCPP_BEGIN_NAMESPACE_STD
1818
namespace __stacktrace {
1919

20-
struct _LIBCPP_HIDE_FROM_ABI context;
20+
struct context;
2121

2222
struct osx {
2323
context& cx_;

libcxx/src/stacktrace/stacktrace.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
#include <__stacktrace/basic_stacktrace.h>
1818
#include <__stacktrace/stacktrace_entry.h>
1919

20-
#include <__stacktrace/detail/alloc.h>
21-
#include <__stacktrace/detail/context.h>
22-
#include <__stacktrace/detail/entry.h>
23-
#include <__stacktrace/detail/to_string.h>
20+
#include <__stacktrace/alloc.h>
21+
#include <__stacktrace/context.h>
22+
#include <__stacktrace/entry.h>
23+
#include <__stacktrace/to_string.h>
2424

2525
_LIBCPP_BEGIN_NAMESPACE_STD
2626
namespace __stacktrace {

libcxx/src/stacktrace/tools/addr2line.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
#include "tools.h"
1515

16-
#include <__stacktrace/detail/context.h>
17-
#include <__stacktrace/detail/entry.h>
16+
#include <__stacktrace/context.h>
17+
#include <__stacktrace/entry.h>
1818
#include <string>
1919

2020
_LIBCPP_BEGIN_NAMESPACE_STD

libcxx/src/stacktrace/tools/atos.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
#include "tools.h"
1717

18-
#include <__stacktrace/detail/alloc.h>
19-
#include <__stacktrace/detail/context.h>
20-
#include <__stacktrace/detail/entry.h>
18+
#include <__stacktrace/alloc.h>
19+
#include <__stacktrace/context.h>
20+
#include <__stacktrace/entry.h>
2121

2222
_LIBCPP_BEGIN_NAMESPACE_STD
2323
namespace __stacktrace {

libcxx/src/stacktrace/tools/llvm_symbolizer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
#include "../common/debug.h"
1616
#include "tools.h"
1717

18-
#include <__stacktrace/detail/context.h>
19-
#include <__stacktrace/detail/entry.h>
18+
#include <__stacktrace/context.h>
19+
#include <__stacktrace/entry.h>
2020

2121
_LIBCPP_BEGIN_NAMESPACE_STD
2222
namespace __stacktrace {

libcxx/src/stacktrace/tools/pspawn.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
# include <unistd.h>
3030
# include <vector>
3131

32-
# include <__stacktrace/detail/context.h>
33-
# include <__stacktrace/detail/entry.h>
32+
# include <__stacktrace/context.h>
33+
# include <__stacktrace/entry.h>
3434

3535
# include "../common/debug.h"
3636
# include "../common/failed.h"

libcxx/src/stacktrace/tools/tools.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#include <list>
1717
#include <string>
1818

19-
#include <__stacktrace/detail/context.h>
20-
#include <__stacktrace/detail/entry.h>
19+
#include <__stacktrace/context.h>
20+
#include <__stacktrace/entry.h>
2121

2222
_LIBCPP_BEGIN_NAMESPACE_STD
2323
namespace __stacktrace {

libcxx/src/stacktrace/tools/toolspawner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# include "../common/failed.h"
2828
# include "pspawn.h"
2929

30-
# include <__stacktrace/detail/entry.h>
30+
# include <__stacktrace/entry.h>
3131

3232
_LIBCPP_BEGIN_NAMESPACE_STD
3333
namespace __stacktrace {

libcxx/src/stacktrace/unwind/unwind.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
# include "./unwind.h"
1414

15-
# include <__stacktrace/detail/context.h>
16-
# include <__stacktrace/detail/entry.h>
15+
# include <__stacktrace/context.h>
16+
# include <__stacktrace/entry.h>
1717
# include <unwind.h>
1818

1919
_LIBCPP_BEGIN_NAMESPACE_STD

libcxx/src/stacktrace/unwind/unwind.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
_LIBCPP_BEGIN_NAMESPACE_STD
1818
namespace __stacktrace {
1919

20-
struct _LIBCPP_HIDE_FROM_ABI context;
20+
struct context;
2121

2222
struct unwind {
2323
context& cx_;

libcxx/src/stacktrace/windows/dbghelp_dll.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# include <mutex>
2222

2323
# include "dll.h"
24-
# include <__stacktrace/detail/entry.h>
24+
# include <__stacktrace/entry.h>
2525

2626
_LIBCPP_BEGIN_NAMESPACE_STD
2727
namespace __stacktrace {

libcxx/src/stacktrace/windows/dbghelp_dll.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# include <cstdlib>
2323
# include <mutex>
2424

25-
# include <__stacktrace/detail/entry.h>
25+
# include <__stacktrace/entry.h>
2626

2727
# include "../common/debug.h"
2828
# include "dll.h"

libcxx/src/stacktrace/windows/dll.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# include <mutex>
2222

2323
# include "dll.h"
24-
# include <__stacktrace/detail/entry.h>
24+
# include <__stacktrace/entry.h>
2525

2626
_LIBCPP_BEGIN_NAMESPACE_STD
2727
namespace __stacktrace {

libcxx/src/stacktrace/windows/dll.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# include <cstdlib>
2323
# include <mutex>
2424

25-
# include <__stacktrace/detail/entry.h>
25+
# include <__stacktrace/entry.h>
2626

2727
# include "../common/debug.h"
2828

0 commit comments

Comments
 (0)