Skip to content

Commit 1575ca2

Browse files
committed
fixup! remove dependency on internal libc++ headers; move common header
1 parent b25d2ab commit 1575ca2

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#ifndef STD_LLDB_COMPRESSED_PAIR_H
22
#define STD_LLDB_COMPRESSED_PAIR_H
33

4-
#include <__memory/compressed_pair.h>
54
#include <type_traits>
65

76
namespace std {
@@ -53,26 +52,27 @@ class __compressed_pair : private __compressed_pair_elem<_T1, 0>,
5352
_T1 &first() { return static_cast<_Base1 &>(*this).__get(); }
5453
};
5554
#elif COMPRESSED_PAIR_REV == 1
55+
template <class _ToPad> class __compressed_pair_padding {
56+
char __padding_[(is_empty<_ToPad>::value && !__libcpp_is_final<_ToPad>::value)
57+
? 0
58+
: sizeof(_ToPad) - __datasizeof(_ToPad)];
59+
};
60+
5661
#define _LLDB_COMPRESSED_PAIR(T1, Initializer1, T2, Initializer2) \
5762
[[__gnu__::__aligned__(alignof(T2))]] [[no_unique_address]] T1 Initializer1; \
58-
[[no_unique_address]] __compressed_pair_padding<T1> _LIBCPP_CONCAT3( \
59-
__padding1_, __LINE__, _); \
63+
[[no_unique_address]] __compressed_pair_padding<T1> __padding1_; \
6064
[[no_unique_address]] T2 Initializer2; \
61-
[[no_unique_address]] __compressed_pair_padding<T2> _LIBCPP_CONCAT3( \
62-
__padding2_, __LINE__, _)
65+
[[no_unique_address]] __compressed_pair_padding<T2> __padding2_;
6366

6467
#define _LLDB_COMPRESSED_TRIPLE(T1, Initializer1, T2, Initializer2, T3, \
6568
Initializer3) \
6669
[[using __gnu__: __aligned__(alignof(T2)), \
6770
__aligned__(alignof(T3))]] [[no_unique_address]] T1 Initializer1; \
68-
[[no_unique_address]] __compressed_pair_padding<T1> _LIBCPP_CONCAT3( \
69-
__padding1_, __LINE__, _); \
71+
[[no_unique_address]] __compressed_pair_padding<T1> __padding1_; \
7072
[[no_unique_address]] T2 Initializer2; \
71-
[[no_unique_address]] __compressed_pair_padding<T2> _LIBCPP_CONCAT3( \
72-
__padding2_, __LINE__, _); \
73+
[[no_unique_address]] __compressed_pair_padding<T2> __padding2_; \
7374
[[no_unique_address]] T3 Initializer3; \
74-
[[no_unique_address]] __compressed_pair_padding<T3> _LIBCPP_CONCAT3( \
75-
__padding3_, __LINE__, _)
75+
[[no_unique_address]] __compressed_pair_padding<T3> __padding3_;
7676
#elif COMPRESSED_PAIR_REV == 2
7777
#define _LLDB_COMPRESSED_PAIR(T1, Name1, T2, Name2) \
7878
[[no_unique_address]] T1 Name1; \

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/unique_ptr/TestDataFormatterLibcxxUniquePtrSimulator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ def _run_test(self, defines):
2626
)
2727

2828

29-
# for r in range(3):
30-
for r in [0, 2]:
29+
for r in range(3):
3130
name = "test_r%d" % r
3231
defines = ["COMPRESSED_PAIR_REV=%d" % r]
3332
f = functools.partialmethod(

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/unique_ptr/main.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#include "../compressed_pair.h"
2-
3-
#include <__memory/allocator_traits.h>
1+
#include <libcxx-simulators-common/compressed_pair.h>
42

53
namespace std {
64
namespace __lldb {
@@ -14,7 +12,7 @@ template <class _Tp, class _Dp = default_delete<_Tp>> class unique_ptr {
1412
public:
1513
typedef _Tp element_type;
1614
typedef _Dp deleter_type;
17-
typedef typename __pointer<_Tp, deleter_type>::type pointer;
15+
typedef _Tp *pointer;
1816

1917
#if COMPRESSED_PAIR_REV == 0
2018
std::__lldb::__compressed_pair<pointer, deleter_type> __ptr_;

0 commit comments

Comments
 (0)