5 Commits

Author SHA1 Message Date
Nerixyz
c061ddbd15
Reland [LLDB] Fix MS STL variant with non-trivial types and PDB (#176189)
Relands #171489 which was reverted due to a test failure on GreenDragon.

As suggested in
https://github.com/llvm/llvm-project/pull/171489#issuecomment-3754098800,
I'm checking for `std::string` on Darwin and `std::basic_string<char>`
otherwise, however I can't test that locally.
2026-01-15 23:13:04 +01:00
Jonas Devlieghere
a0b71b048b
Revert "[LLDB] Fix MS STL variant with non-trivial types" (#176059)
Reverts llvm/llvm-project#171489 because it causes
`TestDataFormatterStdVariant.py` to fail on Darwin.

Affected bots:

- https://ci.swift.org/view/all/job/llvm.org/view/LLDB/job/as-lldb-cmake/
- https://ci.swift.org/view/all/job/llvm.org/view/LLDB/job/lldb-cmake/
2026-01-14 23:29:33 +00:00
Nerixyz
9a632fd684
[LLDB] Fix MS STL variant with non-trivial types (#171489)
When using `std::variant` with non-trivial types, we need to go through
multiple bases to find the `_Which` member. The MSVC STL implements this
in `xsmf_control.h` which conditionally adds/deletes copy/move
constructors/operators.

We now go to `_Variant_base` (the holder of `_Which`). This inherits
from `_Variant_storage`, which is our entry point to finding the n-th
storage (going through `_Tail`).
2026-01-12 11:40:12 +01:00
nerix
7fdf800a91
[LLDB] Run MSVC variant test with PDB (#171858)
Split off from #171489. This only adds the lookup of the active type for
a `std::variant` based on the head type (since PDB doesn't have template
info).
2025-12-11 18:03:42 +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