318 Commits

Author SHA1 Message Date
Matheus Izvekov
91cdd35008
[clang] Improve nested name specifier AST representation (#147835)
This is a major change on how we represent nested name qualifications in
the AST.

* The nested name specifier itself and how it's stored is changed. The
prefixes for types are handled within the type hierarchy, which makes
canonicalization for them super cheap, no memory allocation required.
Also translating a type into nested name specifier form becomes a no-op.
An identifier is stored as a DependentNameType. The nested name
specifier gains a lightweight handle class, to be used instead of
passing around pointers, which is similar to what is implemented for
TemplateName. There is still one free bit available, and this handle can
be used within a PointerUnion and PointerIntPair, which should keep
bit-packing aficionados happy.
* The ElaboratedType node is removed, all type nodes in which it could
previously apply to can now store the elaborated keyword and name
qualifier, tail allocating when present.
* TagTypes can now point to the exact declaration found when producing
these, as opposed to the previous situation of there only existing one
TagType per entity. This increases the amount of type sugar retained,
and can have several applications, for example in tracking module
ownership, and other tools which care about source file origins, such as
IWYU. These TagTypes are lazily allocated, in order to limit the
increase in AST size.

This patch offers a great performance benefit.

It greatly improves compilation time for
[stdexec](https://github.com/NVIDIA/stdexec). For one datapoint, for
`test_on2.cpp` in that project, which is the slowest compiling test,
this patch improves `-c` compilation time by about 7.2%, with the
`-fsyntax-only` improvement being at ~12%.

This has great results on compile-time-tracker as well:

![image](https://github.com/user-attachments/assets/700dce98-2cab-4aa8-97d1-b038c0bee831)

This patch also further enables other optimziations in the future, and
will reduce the performance impact of template specialization resugaring
when that lands.

It has some other miscelaneous drive-by fixes.

About the review: Yes the patch is huge, sorry about that. Part of the
reason is that I started by the nested name specifier part, before the
ElaboratedType part, but that had a huge performance downside, as
ElaboratedType is a big performance hog. I didn't have the steam to go
back and change the patch after the fact.

There is also a lot of internal API changes, and it made sense to remove
ElaboratedType in one go, versus removing it from one type at a time, as
that would present much more churn to the users. Also, the nested name
specifier having a different API avoids missing changes related to how
prefixes work now, which could make existing code compile but not work.

How to review: The important changes are all in
`clang/include/clang/AST` and `clang/lib/AST`, with also important
changes in `clang/lib/Sema/TreeTransform.h`.

The rest and bulk of the changes are mostly consequences of the changes
in API.

PS: TagType::getDecl is renamed to `getOriginalDecl` in this patch, just
for easier to rebasing. I plan to rename it back after this lands.

Fixes #136624
Fixes https://github.com/llvm/llvm-project/issues/43179
Fixes https://github.com/llvm/llvm-project/issues/68670
Fixes https://github.com/llvm/llvm-project/issues/92757
2025-08-09 05:06:53 -03:00
nerix
7b42e7c98e
[LLDB] Add formatters for MSVC STL std::string_view and friends (#150318)
Adds summaries for `std::{,w,u8,u16,u32}string_view`s from MSVC's STL. A
few functions from the string formatting can be reused.

Towards #24834.
2025-07-25 17:01:35 +01:00
nerix
d5c8303af8
[LLDB] Add formatters for MSVC STL std::deque (#150097)
This PR adds synthetic children for std::deque from MSVC's STL.

Similar to libstdc++ and libc++, the elements are in a `T**`, so we need
to "subscript" twice. The [NatVis for
deque](313964b78a/stl/debugger/STL.natvis (L1103-L1112))
uses `_EEN_DS` which contains the block size. We can't access this, but
we can access the [constexpr
`_Block_size`](313964b78a/stl/inc/deque (L641)).

Towards #24834.
2025-07-23 16:19:47 +01:00
nerix
cc380f6e9b
[LLDB] Add formatters for MSVC STL map-like types (#148385)
This PR adds formatters for `std::map`, `std::set`, `std::multimap`,
`std::multiset` as well as their iterators. It's done in one PR because
the types are essentially the same (a tree) except for their value type.
The iterators are required because of the tests.

`MsvcStlTreeIterSyntheticFrontEnd` is based on the libc++ equivalent. As
opposed to `std::list`, there aren't that many duplicates, so I didn't
create a generic type.

For reference, the tree is implemented in
313964b78a/stl/inc/xtree.

Towards #24834.
2025-07-23 12:37:04 +01:00
nerix
287b9447cc
[LLDB] Add formatters for MSVC STL unordered containers (#149519)
Adds formatters for MSVC STL's unordered containers. This one is
relatively simple, because it can reuse the `std::list` synthetic
children. The unordered containers (aka
[`_Hash`](313964b78a/stl/inc/xhash (L327)))
contain a
[`_List`](313964b78a/stl/inc/xhash (L2012))
which contains all elements (and is used for iterating through the
container).

Towards https://github.com/llvm/llvm-project/issues/24834.
2025-07-22 14:16:50 +01:00
nerix
f78c4ce55b
[LLDB] Add formatters for MSVC STL std::atomic (#149801)
Adds synthetic children and a summary provider for `std::atomic` on
MSVC's STL. This currently only supports DWARF because it relies on the
template argument. Once there are PDB tests, this will probably use the
return type of some method like `value()` because template types aren't
available there.

Towards #24834.
2025-07-22 12:34:26 +01:00
nerix
401b5ccf6b
[LLDB] Add formatters for MSVC STL std::variant (#148554)
Adds a summary and synthetic children for MSVC STL's `std::variant`.

This one is a bit complicated because of DWARF vs PDB differences. I put
the representations in comments. Being able to `GetChildMemberWithName`
a member in an anonymous union would make this a lot simpler
(`std::optional` will have something similar iirc).

Towards #24834.
2025-07-21 12:46:34 +01:00
nerix
f0a7462cf0
[LLDB] Add formatters for MSVC STL std::optional (#149545)
Adds synthetic children for `std::optional` from MSVC's STL. Most of the
machinery for `std::optional` is already there.

Towards #24834.
2025-07-21 10:20:47 +01:00
Michael Buch
3121cc31ba [lldb][test] TestNSDictionarySynthetic.py: adjust ptr depth in test
Fixes failure after we introduced a default limit in
https://github.com/llvm/llvm-project/pull/149282

We already did this test change on the Apple fork.
2025-07-18 10:05:18 +01:00
David Spickett
d87170211d [lldb][test] Remove XFAIL from some Windows tests
These are now passing on Windows x86_64 and Arm64.
2025-07-17 09:17:25 +00:00
nerix
88a498c3b1
[LLDB] Add formatters for MSVC STL std::(forward_)list (#148285)
Adds synthetic providers for MSVC's `std::forward_list` and `std::list`.
It refactors `LibCxxList` to be generic over the STL type (currently
libc++ or MSVC STL). The libstdc++ synthetic providers use something
similar in Python
[here](3092b765ba/lldb/examples/synthetic/gnu_libstdcpp.py (L134)).
Eventually, this could be ported to C++ as well.

Towards #24834.
2025-07-16 14:00:18 +01:00
nerix
5ae4939395
[LLDB] Add formatters for MSVC STL std::vector (#147538)
This adds synthetic child providers for `std::vector<T>` and
`std::vector<bool>` for MSVC's STL.

The structure of a `std::vector<T>` is relatively similar to libc++'s
implementation that uses `__begin` and `__end`.
`std::vector<bool>` is different. It's a `std::vector<unsigned int>`
wrapper instead of `std::vector<uint8_t>`. This makes the calculation
slightly less simple. I put a comment in the `GetChildAtIndex` to make
this clear.

- [NatVis for
`std::vector<T>`](313964b78a/stl/debugger/STL.natvis (L1193-L1205))
- [NatVis for
`std::vector<bool>`](313964b78a/stl/debugger/STL.natvis (L1167-L1179))

Towards #24834.
2025-07-16 10:02:50 +01:00
nerix
95fa67603c
[LLDB] Compile API tests with exceptions enabled on Windows (#148691)
From #148554 - compile tests with exceptions on Windows
(`-fno-exceptions` was added 11 years ago in
c7826524acda6a9c8816261d5c48b94dc92935ed). The variant test uses `try {}
catch {}` to create variants that are valueless by exception. On other
platforms, exceptions are enabled as well.

I have no clue why compiling with exceptions will optimize out
`a_long_guy` in the changed test (even with `-O0`). Taking the address
of that value will ensure it's kept.
2025-07-15 11:38:43 -07:00
nerix
eec98bef84
[LLDB] Add formatters for MSVC STL std::tuple (#148548)
Adds synthetic children for MSVC STL's
[`std::tuple`](313964b78a/stl/inc/tuple).
A `tuple` is a chain of base classes:
```cpp
template <>
class tuple<> {};

template <class _This, class... _Rest>
class tuple<_This, _Rest...> : private tuple<_Rest...> {
  _Tuple_val<_This> _Myfirst;
};
```

So the provider walks the base classes to the desired one.

The implementation makes it hard to detect if the empty tuple is from
this STL. Fortunately, libstdc++'s synthetic children provider works for
empty MSVC STL tuples as well.

Towards #24834.
2025-07-15 17:17:28 +01:00
nerix
da68e72b1b
[LLDB] Add formatters for MSVC STL std::unique_ptr (#148248)
This PR adds a summary and synthetic children for `std::unique_ptr` from
MSVC's STL
([NatVis](313964b78a/stl/debugger/STL.natvis (L285-L303))).

As with libc++, the deleter is only shown if it's non-empty.

Tested both the shared_ptr and unique_ptr tests on Windows.
Towards #24834.
2025-07-14 11:18:43 +01:00
nerix
def7bbbe17
[LLDB] Add formatters for MSVC STL std::shared_ptr (#147575)
This PR adds formatters for `std::shared_ptr` and `std::weak_ptr`. They
are similar to the ones from libc++ and libstdc++.
[Section from MSVC STL
NatVis](313964b78a/stl/debugger/STL.natvis (L512-L578)).

To support debugging with PDB debug info, I had to add an early exit in
`GetDesugaredSmartPointerValue`, because with PDB, LLDB doesn't know
about template types. This isn't an issue here, since the typedef type
is already resolved there, so no casting is needed.

The tests don't check for PDB - maybe this should be changed? I don't
know a good way to do this. PDB has the downside that it resolves
typedefs. Here in particular, the test for `element_type` would need to
be replaced with `User` and `std::string` with
`std::basic_string<char,std::char_traits<char>,std::allocator<char> >`.

Towards #24834.
2025-07-11 09:37:06 +01:00
Michael Buch
f1cee58789
[lldb][test] Combine libstdc++ and libc++ iterator tests into generic test (#147175)
This combines the libc++ and libstdc++ test cases. The libstdcpp tests
were a subset of the libc++ test, so this patch moves the libcxx test
into generic and removes the libstdcpp test entirely.

There are currently no formatters for libstdcpp
std::unorderd_map::iterator. So I removed those test-cases. We already
test them for libc++ in `libcxx/unordered_map-iterator`. And we test
`std::unordered_map` in `generic/unorderd`. So these test-cases would be
redundant.

Split out from https://github.com/llvm/llvm-project/pull/146740
2025-07-11 09:35:16 +01:00
Michael Buch
9d8058e3b8
[lldb][test] Move std::function from libcxx to generic directory (#147701)
This just moves the test from `libcxx` to `generic`. There are currently
no `std::function` formatters for libstdc++ so I didn't add a test-case
for it.

Split out from https://github.com/llvm/llvm-project/pull/146740
2025-07-09 22:16:59 +01:00
Michael Buch
e7c9f29fc5
[lldb][test] Move std::initializer_list from libcxx to generic directory (#147702)
This just moves the test from `libcxx` to `generic`. There are currently
no `std::initializer_list` formatters for libstdc++ so I didn't add a
test-case for it.

Split out from https://github.com/llvm/llvm-project/pull/146740
2025-07-09 16:40:23 +01:00
Michael Buch
cbb2ef3835 [lldb][test] Fix MSVC std::string formatter tests
These were mistakenly changed during https://github.com/llvm/llvm-project/pull/147525
2025-07-09 16:09:20 +01:00
Michael Buch
fa80a1a4d4
[lldb][test] Move std::ranges::ref_view from libcxx to generic directory (#147705)
This just moves the test from `libcxx` to `generic`. There are currently
no `std::ranges::ref_view` formatters for libstdc++ so I didn't add a
test-case for it.

Split out from https://github.com/llvm/llvm-project/pull/146740
2025-07-09 14:20:57 +01:00
Michael Buch
1e6dd8c1e4
[lldb][test] Merge MSVC STL std::(u8)string tests into generic directory (#147525)
Now that most STL formatter tests have been moved to `generic`. Do the
same for the MSVC tests (which are currently just for `std::string`).
The `std::string` test was mostly the same (MSVC just had 1 additional
check, which I moved over).

We also only tested `u8string` with MSVC. So i moved those into
`generic` as-is. I kept it separate from the existing std::string tests
since it requires c++20.

The tests are currently failing for libc++ and libstdc++ because MSVC
had a test case which checked that:
```
  std::string overwritten_zero("abc");
  const_cast<char *>(overwritten_zero.data())[3] = 'd';
```
prints as `"abc"`. But libc++ and libstdc++ print it as `"abcd"` (which
seems like the more correct thing to do?)
2025-07-09 14:20:44 +01:00
Michael Buch
13a1a632c2
[lldb][test] Move std::valarray from libcxx to generic directory (#147704)
This just moves the test from `libcxx` to `generic`. There are currently
no `std::valarray` formatters for libstdc++ so I didn't add a test-case
for it.

Split out from https://github.com/llvm/llvm-project/pull/146740
2025-07-09 14:20:22 +01:00
Michael Buch
ba6f87248b
[lldb][test] Move std::unordered_map::iterator from libcxx to generic… (#147703)
… directory

This just moves the test from `libcxx` to `generic`. There are currently
no `std::unordered_map::iterator` formatters for libstdc++ so I didn't
add a test-case for it.

Split out from https://github.com/llvm/llvm-project/pull/146740
2025-07-09 12:57:54 +01:00
Michael Buch
b0cc1867a3
[lldb][test] Move std::span from libcxx to generic directory (#147680)
This just moves the test from `libcxx` to `generic`. There are currently
no `std::span` formatters for libstdc++ so I didn't add a test-case for
it.

Split out from https://github.com/llvm/llvm-project/pull/146740
2025-07-09 12:57:36 +01:00
Michael Buch
ff05d26a29
[lldb][test] Move std::string_view from libcxx to generic directory (#147563)
This just moves the test from `libcxx` to `generic`. There are currently
no `std::string_view` formatters for libstdc++ so I didn't add a
test-case for it.

Split out from https://github.com/llvm/llvm-project/pull/146740
2025-07-09 12:35:22 +01:00
Michael Buch
d338d197e7
[lldb][test] Move std::queue from libcxx to generic directory (#147529)
This just moves the test from `libcxx` to `generic`. There are currently
no `std::queue` formatters for libstdc++ so I didn't add a test-case for
it.

Split out from https://github.com/llvm/llvm-project/pull/146740
2025-07-08 15:22:38 +01:00
Michael Buch
f9999184dd
[lldb][Formatters] Consistently unwrap pointer element_type in std::shared_ptr formatters (#147340)
Follow-up to
https://github.com/llvm/llvm-project/pull/147165#pullrequestreview-2992585513

Currently when we explicitly dereference a std::shared_ptr, both the
libstdc++ and libc++ formatters will cast the type of the synthetic
pointer child to whatever the `std::shared_ptr::element_type` is aliased
to. E.g.,
```
(lldb) v p
(std::shared_ptr<int>) p = 10 strong=1 weak=0 {
  pointer = 0x000000010016c6a0
}
(lldb) v *p
(int) *p = 10
```

However, when we print (or dereference) `p.pointer`, the type devolves
to something less user-friendly:
```
(lldb) v p.pointer
(std::shared_ptr<int>::element_type *) p.pointer = 0x000000010016c6a0
(lldb) v *p.pointer
(std::shared_ptr<int>::element_type) *p.pointer = 10
```

This patch changes both formatters to store the casted type. Then
`GetChildAtIndex` will consistently use the unwrapped type.
2025-07-08 14:45:15 +01:00
Michael Buch
1f28da60d5
[lldb][test] Combine libstdc++ and libc++ std::string tests into generic test (#147355)
This combines the libc++ and libstdc++ test cases. The main difference
was that the libstdcpp tests had additional tests for
references/pointers to std::string. I moved those over.

The libstdc++ formatters don't support `std::u16string`/`std::u32string`
yet, so I extracted those into XFAILed test cases.

There were also two test assertions that failed for libstdc++:
1. libstdc++ doesn't obey the capped/uncapped summary options
2. When a summary isn't available for a std::string, libc++ would print
"Summary Unavailable", whereas libstdc++ just prints "((null))". This
may be better suited for the STL-specific subdirectories, but left it
here for now.

I put those in separate XFAILed test-cases.

Split out from https://github.com/llvm/llvm-project/pull/146740
2025-07-08 14:09:48 +01:00
Michael Buch
d9b208b4d3
[lldb][test] Combine libstdc++ and libc++ std::variant tests into generic test (#147253)
This combines the libc++ and libstdc++ test cases. The libstdc++ test
had an additional test-case for "reference to typedef". So I added those
to the generic test. The rest of the tests was the same as libc++.

I also moved the test-case for checking invalid variant indexes into a
separate libstdcpp test because it relied on the layout of the libstdc++
type. We should probably rewrite it in the "simulator" style. But for
now I just moved it.

This also removes some redundant checks for libc++ versions and
existence of the `variant` header, which at this point should be
available anywhere these tests are run.

Split out from https://github.com/llvm/llvm-project/pull/146740
2025-07-08 14:09:32 +01:00
nerix
45689b26eb
[LLDB] Add type summaries for MSVC STL strings (#143177)
This PR adds type summaries for
`std::{string,wstring,u8string,u16string,u32string}` from the MSVC STL.

See https://github.com/llvm/llvm-project/issues/24834 for the MSVC STL
issue.

The following changes were made:

- `dotest.py` now detects if the MSVC STL is available. It does so by
looking at the target triple, which is an additional argument passed
from Lit. It specifically checks for `windows-msvc` to not match on
`windows-gnu` (i.e. MinGW/Cygwin).
- (The main part): Added support for summarizing `std::(w)string` from
MSVC's STL. Because the type names from the libstdc++ (pre C++ 11)
string types are the same as on MSVC's STL, `CXXCompositeSummaryFormat`
is used with two entries, one for MSVC's STL and one for libstdc++.
With MSVC's STL, `std::u{8,16,32}string` is also handled. These aren't
handled for libstdc++, so I put them in `LoadMsvcStlFormatters`.
2025-07-08 09:55:18 +01:00
Michael Buch
fd997d86f0
[lldb][test] Combine libstdc++ and libc++ tuple tests into generic test (#147139)
This combines the libc++ and libstdc++ test cases. The main difference
was that the libstdcpp tests had some tuple indexing tests that libc++
didn't have.

The libstdc++ formatter didn't support size summaries for std::tuple. So
I added a `ContainerSizeSummaryProvider` for it (like we do for libc++).
Additionally, the synthetic frontend would only apply to non-empty
tuples, so I adjusted the regex to match empty ones too. We do this for
libc++ already.

Split out from https://github.com/llvm/llvm-project/pull/146740
2025-07-08 09:01:10 +01:00
Michael Buch
9ebe6f9a1f
[lldb][test] Fix libstdc++ std::variant formatter tests for valueless variants (#147283)
A default-constructed variant has a valid index (being the first element
of the variant). The only case where the index is variant_npos is when
the variant is "valueless", which [according to
cppreference](https://en.cppreference.com/w/cpp/utility/variant/valueless_by_exception.html)
only happens when an exception is thrown during assignment to the
variant.

I adjusted the test to test that scenario, and the formatter seems to
work.

Unblocks https://github.com/llvm/llvm-project/pull/147253
2025-07-07 14:28:19 +01:00
Michael Buch
e14e98290e
[lldb][test] Combine libstdc++ and libc++ std::shared_ptr tests into generic test (#147141)
This combines the libc++ and libstdc++ test cases. The libstdcpp tests
were a subset of the libc++ test, so this patch moves the libcxx test
into `generic` and removes the libstdcpp test entirely.

Split out from https://github.com/llvm/llvm-project/pull/146740
2025-07-07 12:48:15 +01:00
Michael Buch
40fb90efed
[lldb][Formatters] Add shared/weak count to libstdc++ std::shared_ptr summary (#147166)
Depends on https://github.com/llvm/llvm-project/pull/147165

This adds weak/strong counts to the std::shared_ptr summary of the
libstdcxx formatters. We already do this for libcxx. This will make it
easier to consolidate the tests into a generic one (see
https://github.com/llvm/llvm-project/pull/147141).
2025-07-07 12:08:24 +01:00
Michael Buch
c19c71b905
[lldb][test] Split out libc++ std::string tests that check corrupted strings (#147252)
As a pre-requisite to combine the libcxx and libstdcxx string formatter
tests (see https://github.com/llvm/llvm-project/pull/146740) this patch
splits out the libcxx specific parts into a separate test.

These are probably best tested with the libcxx-simulator tests. But for
now I just moved them.
2025-07-07 11:33:33 +01:00
Michael Buch
074ccde3b0
[lldb][Formatter] Consolidate libstdc++ and libc++ unique_ptr formatter tests into generic test (#147031)
The libc++ test was a subset of the tests in libstdc++. This test moves
the libc++ test into `generic` and somne additional test-cases from
`libstdc++` (specifically the recursive unique_ptr case). It turns out
the libstdc++ formatter supports dereferencing using the "object" or
"obj" names. We could either drop those from the tests or support the
same for libc++. I took the latter approach but don't have strong
opinions on this.

Split out from https://github.com/llvm/llvm-project/pull/146740
2025-07-07 10:13:03 +01:00
Michael Buch
49d7c53756
[lldb][test] Combine libstdc++ and libc++ std::map tests into generic test (#147174)
This combines the libc++ and libstdc++ test cases. The libstdcpp tests
were a subset of the libc++ test, so this patch moves the libcxx test
into generic and removes the libstdcpp test entirely.

Split out from https://github.com/llvm/llvm-project/pull/146740
2025-07-07 09:14:10 +01:00
Michael Buch
6fec6a98c0
[lldb][Formatters] Make libc++ and libstdc++ std::shared_ptr formatters consistent with each other (#147165)
This patch adjusts the libcxx and libstdcxx std::shared_ptr formatters
to look the same.

Changes to libcxx:
* Now creates a synthetic child called `pointer` (like we already do for
`std::unique_ptr`)

Changes to libstdcxx:
* When asked to dereference the pointer, cast the type of the result
ValueObject to the element type (which we get from the template argument
to std::shared_ptr).
Before:
```
(std::__shared_ptr<int, __gnu_cxx::_S_atomic>::element_type) *foo = 123
```
After:
```
(int) *foo = 123
```

Tested in https://github.com/llvm/llvm-project/pull/147141
2025-07-07 09:13:52 +01:00
Michael Buch
b7d4735a0e
[lldb][test] Combine libstdc++ and libc++ vector<bool> tests into generic test (#147137)
The libc++ and libstdc++ tests were pretty much an exact copy of each
other. This test moves the libc++ test into generic removes it from
libstdc++. I moved the `GLIBCXX_DEBUG` case over from libstdcxx. For
some reason the libstdcxx test was skipped, but it passes on my Linux
machine. So I unskipped it for now.

Split out from https://github.com/llvm/llvm-project/pull/146740
2025-07-07 08:39:47 +01:00
Michael Buch
32946eb124
[lldb][Formatters] Fix weak reference count for std::shared_ptr/std::weak_ptr (#147033)
For the `__shared_owners_` we need to add `+1` to the count, but for
`__shared_weak_owners_` the value reflects the exact number of weak
references.
2025-07-04 15:31:47 +01:00
Michael Buch
a89e232058
[lldb][DataFormatter] Format libstdc++ unique_ptr like we do libc++ (#146909)
The only difference is that with libc++ the summary string contains the
derefernced pointer value. With libstdc++ we currently display the
pointer itself, which seems redundant. E.g.,
```
(std::unique_ptr<int>) iup = 0x55555556d2b0 {
  pointer = 0x000055555556d2b0
}
(std::unique_ptr<std::basic_string<char> >) sup = 0x55555556d2d0 {
  pointer = "foobar"
}
```

This patch moves the logic into a common helper that's shared between
the libc++ and libstdc++ formatters.

After this patch we can combine the libc++ and libstdc++ API tests (see
https://github.com/llvm/llvm-project/pull/146740).
2025-07-04 09:18:24 +01:00
Michael Buch
59e812f2ee [lldb][test] Skip pointer to std::unordered_map formatter tests on older Clang versions
These only work after https://github.com/llvm/llvm-project/pull/143501 and https://github.com/llvm/llvm-project/pull/144517. Skip on older compilers. This currently fails on the macOS matrix bots that run the LLDB test-suite with older Clang versions.

See https://github.com/llvm/llvm-project/issues/146040.
2025-07-04 07:39:13 +01:00
Michael Buch
a88e286aef
[lldb][test] Consolidate libstdc++ and libc++ vector formatter tests into generic test (#146885)
The libstdc++ test was a subset of the tests in libc++. This test moves
the libc++ test into `generic` and removes the `libstdc++` tests. I
retained the `-D_GLIBCXX_DEBUG` test cases though.

Split out from https://github.com/llvm/llvm-project/pull/146740
2025-07-03 15:44:40 +01:00
Michael Buch
522d743545
[lldb][test] Run generic set formatter test-case on specified STL (#146882)
Previously the parameter wasn't respected. So we would only run the test
with whatever stdlib the `Makefile.rules` deduced.

Confirmed that
```
lldb-dotest -p TestDataFormatterGenericSet.py --category libstdcxx
```
passes on my machine.
2025-07-03 15:35:28 +01:00
Michael Buch
10dc4e122a
[lldb][test] Turn std::chrono libcxx test generic (#146873)
Split out from #146740
2025-07-03 15:21:05 +01:00
Michael Buch
b0444b0473
[lldb][test] Turn std::atomic libcxx test generic (#146843)
Split out from https://github.com/llvm/llvm-project/pull/146740
2025-07-03 15:20:53 +01:00
A. Jiang
119705e5ad
[lldb][test] Synchronize __compressed_pair_padding with libc++ (#142516)
This PR mirrors changes of `__compressed_pair_padding` in libc++ into
lldb test suite.

Related PR for libc++:
- #108956
- #109028
- #142125
2025-07-03 13:57:20 +08:00
Michael Buch
e32439249d
[lldb][test] Consolidate generic and libcxx std::deque formatter tests (#146697)
The plan is to move all STL formatter API tests into a single directory.

The `std::deque` test is currently the only test that is duplicated
between the `libcxx` and `generic` directories. This patch moves the
libcxx deque tests into `generic` (moving over any functionality that
wasn't tested in the `generic` tests, mainly formatting
pointers/references to `std::deque`).
2025-07-02 16:05:09 +01:00
Michael Buch
fc00256b2b [lldb][test][NFC] Rename libcxx unordered_map tests to unordered_map-iterator
The actual `unordered_map` tests live in
`data-formatter-stl/generic/unordered`. The tests here are only testing
`std::unordered_map::iterator`. This patch renames the directory
accordingly. This is in preparation for moving all of the STL tests into
the `generic` directory.
2025-07-02 14:36:41 +01:00