diff options
author | Michael Buch <michaelbuch12@gmail.com> | 2024-07-08 15:56:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-08 15:56:05 +0100 |
commit | 9dca3ac2efb180398ef8e84bfa9f0ef283d0e6fd (patch) | |
tree | 4d0fc2f583bfceb0b20d66274b750556e39086ed /llvm/tools/llvm-objdump | |
parent | a5bfe20f6fd8957f870f8ffcf836d7737864e063 (diff) | |
download | llvm-9dca3ac2efb180398ef8e84bfa9f0ef283d0e6fd.zip llvm-9dca3ac2efb180398ef8e84bfa9f0ef283d0e6fd.tar.gz llvm-9dca3ac2efb180398ef8e84bfa9f0ef283d0e6fd.tar.bz2 |
[lldb][DataFormatter] Simplify libc++ std::map::iterator formatter (#97713)
Depends on https://github.com/llvm/llvm-project/pull/97687
Similar to https://github.com/llvm/llvm-project/pull/97579, this patch
simplifies the way in which we retrieve the key/value pair of a
`std::map` (in this case of the `std::map::iterator`).
We do this for the same reason: not only was the old logic hard to
follow, and encoded the libc++ layout in non-obvious ways, it was also
fragile to alignment miscalculations
(https://github.com/llvm/llvm-project/pull/97443); this would break once
the new layout of std::map landed as part of
https://github.com/llvm/llvm-project/issues/93069.
Instead, this patch simply casts the `__iter_pointer` to the
`__node_pointer` and uses a straightforward
`GetChildMemberWithName("__value_")` to get to the key/value we care
about.
We can eventually re-use the core-part of the `std::map` and
`std::map::iterator` formatters. But it will be an easier to change to
review once both simplifications landed.
Diffstat (limited to 'llvm/tools/llvm-objdump')
0 files changed, 0 insertions, 0 deletions